user www-data; worker_processes auto; pid /run/nginx.pid; error_log /dev/stderr warn; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; access_log /dev/stdout; sendfile on; keepalive_timeout 65; client_max_body_size 64M; server { listen 80; server_name _; root /var/www/html/public; index index.php; # Gzip gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml; # Assets Vite — cache long location /build { expires 1y; add_header Cache-Control "public, immutable"; try_files $uri =404; } # Laravel front controller location / { try_files $uri $uri/ /index.php?$query_string; } # PHP-FPM location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 300; } location ~ /\.ht { deny all; } } }