worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name _; root /var/www/html; index index.php index.html; # Main location block location / { try_files $uri $uri/ /index.php?$query_string; } # PHP-FPM handler - all .php files are processed by PHP-FPM location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } # Allow access to static files (HTML, CSS, JS, images) location ~* \.(html|css|js|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ { expires max; access_log off; } # Security: deny access to hidden files location ~ /\. { deny all; } } }