我正在创建一个运行 NginX 和 PHP-FPM (使用 Supervisor) 的 Docker 映像。容器作为 www-data 运行,但未创建 PHP-FPM 套接字。
这是我的配置文件:
閣下網站
[www]
listen = /var/run/php/php7.3-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
user = www-data
group = www-data
pm = ondemand
pm.max_children = 72
pm.process_idle_timeout = 10s;
pm.max_requests = 1000
我的网站配置文件
server {
...
location ~ \.php$ {
try_files $uri $uri/ /doku.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
...
}
主管配置:PHP-FPM
[program:php-fpm]
command=php-fpm
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
stdout-encoding=utf-8
主管配置:NginX
[program:nginx]
command=nginx -g "daemon off;"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
监控配置文件
[unix_http_server]
file=/opt/run/supervisord.sock ; (the path to the socket file)
username = dummy
password = dummy
[supervisord]
logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
loglevel=info ; (log level;default info; others: debug,warn,trace)
user = www-data
pidfile = /opt/run/supervisord.pid
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket
username = dummy
password = dummy
[include]
files = /etc/supervisor/conf.d/*.conf
提前感谢