server { listen 80; server_name _; root /var/www/html/public; index index.php; server_tokens off; autoindex off; location ~ /\. { return 404; } location / { try_files $uri $uri/ /index.php?$query_string; } # Only the front controller may execute; never arbitrary uploaded PHP. location = /index.php { include fastcgi_params; fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php; fastcgi_param HTTP_PROXY ""; fastcgi_pass app:9000; } location ~* \.php(?:/|$) { return 404; } }