From 234932372c50e6199b4defeacdb8032aa741cbd5 Mon Sep 17 00:00:00 2001 From: deepak silaych Date: Tue, 19 Nov 2024 01:28:16 +0530 Subject: [PATCH] Add nginx configuration for production --- nginx.conf | 64 ------------------------------------------------------ 1 file changed, 64 deletions(-) delete mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 5961fc6..0000000 --- a/nginx.conf +++ /dev/null @@ -1,64 +0,0 @@ -server { - listen 80; - server_name mumbaiflood.in www.mumbaiflood.in; - - # Security headers - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-XSS-Protection "1; mode=block"; - add_header X-Content-Type-Options "nosniff"; - add_header Referrer-Policy "strict-origin-when-cross-origin"; - add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: https:; worker-src 'self' blob:;"; - - # Gzip compression - gzip on; - gzip_vary on; - gzip_min_length 10240; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript application/xml application/json; - gzip_disable "MSIE [1-6]\."; - - # Cache control - location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff2)$ { - root /usr/share/nginx/html; - expires 1y; - add_header Cache-Control "public, no-transform"; - } - - # Root directory - root /usr/share/nginx/html; - index index.html; - - # React router support - location / { - try_files $uri $uri/ /index.html; - - # Don't cache HTML files - add_header Cache-Control "no-store, no-cache, must-revalidate"; - } - - # Error pages - error_page 404 /index.html; - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - # Deny access to hidden files - location ~ /\. { - deny all; - access_log off; - log_not_found off; - } - - # Optional: API proxy - # location /api/ { - # proxy_pass https://api.mumbaiflood.in/; - # proxy_http_version 1.1; - # proxy_set_header Upgrade $http_upgrade; - # proxy_set_header Connection 'upgrade'; - # proxy_set_header Host $host; - # proxy_cache_bypass $http_upgrade; - # proxy_set_header X-Real-IP $remote_addr; - # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # } -}