php-env/docker/conf/nginx.conf
2025-08-21 11:35:28 +03:00

58 lines
1.1 KiB
Nginx Configuration File

pid /tmp/nginx.pid;
worker_processes auto;
error_log /dev/stderr warn;
events {
worker_connections 2048;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
client_max_body_size 20M;
access_log /dev/stdout;
error_log /dev/stderr;
gzip on;
upstream php-upstream {
server 127.0.0.1:9000;
}
server {
listen 80;
listen [::]:80;
root /app/public;
index index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
include fastcgi_params;
fastcgi_pass php-upstream;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
location ~ \.php$ {
return 404;
}
}
}