Portál AbcLinuxu, 6. května 2024 01:49
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; must be separated by a comma. If this value is left blank, connections will be ; accepted from any ip address. ; Default Value: any ;listen.allowed_clients = 127.0.0.1Prikladam dockerfile, nginx configuraci a onelinery, kdyby si to nekdo ze zvedavosti chtel pustit. Diky za rady https://pastebin.com/NPK8czCL
sudo docker build -t mynginx --no-cache . ; sudo docker build --no-cache -t mynginx . ; sudo docker stop mynginx ; sudo docker rm mynginx ; sudo docker run -d --name mynginx --hostname=mynginx -network=my-bridge -p 8080:80 mynginx sudo docker build -t myphp --no-cache . ; sudo docker stop myphp ; sudo docker rm myphp ;sudo docker run -d --hostname=myphp --name myphp --volumes-from=mynginx --network=my-bridge myphp
/var/log/php*.log
?
root@56ae29f385a0:/# cgi-fcgi -bind -connect myphp:9000 X-Powered-By: PHP/7.1.7 Content-type: text/html; charset=UTF-8
bash-4.3# ls -lha /etc/nginx/ total 40 drwxr-xr-x 4 root root 4.0K Aug 14 20:57 . drwxr-xr-x 18 root root 4.0K Aug 14 20:58 .. drwxr-xr-x 2 root root 4.0K Aug 14 20:57 conf.d -rw-r--r-- 1 root root 1.1K Aug 5 20:37 fastcgi.conf -rw-r--r-- 1 root root 1007 Aug 5 20:37 fastcgi_params -rw-r--r-- 1 root root 3.9K Aug 5 20:37 mime.types drwxr-xr-x 2 root root 4.0K Aug 14 20:57 modules -rw-r--r-- 1 root root 2.6K Aug 5 20:37 nginx.conf -rw-r--r-- 1 root root 636 Aug 5 20:37 scgi_params -rw-r--r-- 1 root root 664 Aug 5 20:37 uwsgi_params
bash-4.3# diff fastcgi.conf fastcgi_params --- fastcgi.conf +++ fastcgi_params @@ -1,5 +1,4 @@ -fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type;
SCRIPT_FILENAME
předat cestu tak, jak platí v tom PHP kontejneru. Pokud používáte standardní php71-fpm kontejner, mělo by fungovat tohle:
location ~ \.php$ { include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; fastcgi_pass php; }
Tiskni Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.