server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /var/www/atheos; index index.php index.html; # --- logging --------------------------------------------------------- access_log /var/log/nginx/atheos.access.log; error_log /var/log/nginx/atheos.error.log; # --- PHP: the socket path here MUST byte-match the pool's `listen =` # in /etc/php83/php-fpm.d/www.conf (interface I-1 -> else bare 502) location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php-fpm83/php-fpm.sock; fastcgi_index index.php; include fastcgi.conf; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location / { try_files $uri $uri/ =404; } # --- hardening (free, no downside) ----------------------------------- # never serve the VCS directory, the app's private data, or dotfiles location ~ /\.git { deny all; } location ~ /\.ssh { deny all; } location ~ /\. { deny all; } location ~ ^/data/ { deny all; } location ~ ^/(config\.php|common\.php|controller\.php|traits/) { deny all; } location ~* \.(md|py|sh|log|conf|ini|sql|bak|orig)$ { deny all; } add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; client_max_body_size 64m; # Atheos serves theme/main.min.css and the generated *.min.js/css bundles from STABLE URLs # with no cache headers. Without this, a CSS/JS change stays invisible behind a cached copy # until the user hard-refreshes. "no-cache" permits caching but forces revalidation, so a # 304 keeps normal loads fast while guaranteeing updates are picked up on the next load. location ~* \.(css|js)$ { add_header Cache-Control "no-cache, must-revalidate"; try_files $uri =404; } }