# /etc/nginx/sites-available/seo-platform  (then: ln -s ../sites-available/seo-platform /etc/nginx/sites-enabled/)
# TLS is added by: sudo certbot --nginx -d seo.intelliworkz.tech
server {
    listen 80;
    listen [::]:80;
    server_name seo.intelliworkz.tech;
    root /var/www/seo-platform/current/public;
    index index.php;
    charset utf-8;
    client_max_body_size 10M;

    # Internal tool: keep it out of search engines and frames.
    add_header X-Robots-Tag "noindex, nofollow" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;

    # Optional: restrict to office / VPN IPs (uncomment and edit)
    # allow 203.0.113.10;   # Ahmedabad office
    # allow 198.51.100.0/24; # VPN
    # deny all;

    location / { try_files $uri $uri/ /index.php?$query_string; }
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    location ~ ^/build/ { expires 1y; add_header Cache-Control "public, immutable"; access_log off; }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php/php8.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_hide_header X-Powered-By;
        fastcgi_read_timeout 120;
    }
    location ~ /\.(?!well-known).* { deny all; }
}
