# Add within your existing HTTPS server block. Set the document root exactly.
root /var/www/tivilux/public;
index index.html;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy no-referrer always;
add_header X-Frame-Options DENY always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; media-src 'self' blob:; connect-src 'self'; worker-src 'self' blob:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'" always;
location / { try_files $uri $uri/ =404; }
location ~ /\. { deny all; }
location ~ \.php$ {
  try_files $uri =404;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  fastcgi_pass unix:/run/php/php8.3-fpm.sock;
  fastcgi_buffering off;
  fastcgi_read_timeout 86400s;
  # Avoid logging opaque media tickets. Never enable upstream URL debug logging.
  access_log off;
}
