Docker-PHP/nginx/NginxDefault

66 lines
2.1 KiB
Text
Raw Normal View History

2019-06-11 14:59:58 +00:00
server {
listen 80 default_server;
listen [::]:80 default_server;
client_max_body_size 1024M;
root /app/public;
server_name _;
index index.html index.php index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$args;
}
2019-11-09 00:14:13 +00:00
# Pass thru status and ping requests to PHP-FPM
location = /fpm-status {
2019-11-09 00:14:13 +00:00
access_log off;
allow 127.0.0.1;
allow 10.0.0.0/8;
allow 172.16.0.0/12;
allow 192.168.0.0/16;
deny all;
fastcgi_pass unix:/run/php/php{{PHP}}-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /fpm-ping {
2019-11-09 00:14:13 +00:00
access_log off;
allow 127.0.0.1;
allow 10.0.0.0/8;
allow 172.16.0.0/12;
allow 192.168.0.0/16;
deny all;
fastcgi_pass unix:/run/php/php{{PHP}}-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
2019-06-11 14:59:58 +00:00
# pass PHP scripts to PHP{{PHP}}-FPM server socket
#
location ~ \.php$ {
try_files $uri $uri/ /index.php?$args;
fastcgi_pass unix:/run/php/php{{PHP}}-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 300;
include fastcgi_params;
2021-07-13 14:47:23 +00:00
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
2019-06-11 14:59:58 +00:00
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}