default.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. server {
  2. listen 80;
  3. server_name admin.dzhhzy.com;
  4. # Proxy settings
  5. location / {
  6. proxy_pass http://nextjs:3000;
  7. proxy_http_version 1.1;
  8. proxy_set_header Upgrade $http_upgrade;
  9. proxy_set_header Connection 'upgrade';
  10. proxy_set_header Host $host;
  11. proxy_set_header X-Real-IP $remote_addr;
  12. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  13. proxy_set_header X-Forwarded-Proto $scheme;
  14. proxy_cache_bypass $http_upgrade;
  15. }
  16. # Security headers
  17. add_header X-Frame-Options "SAMEORIGIN" always;
  18. add_header X-XSS-Protection "1; mode=block" always;
  19. add_header X-Content-Type-Options "nosniff" always;
  20. add_header Referrer-Policy "no-referrer-when-downgrade" always;
  21. # Gzip compression
  22. gzip on;
  23. gzip_vary on;
  24. gzip_proxied any;
  25. gzip_comp_level 6;
  26. gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
  27. # 日志格式
  28. access_log /var/log/nginx/match.dzhhzy.com.access.log;
  29. error_log /var/log/nginx/match.dzhhzy.com.error.log;
  30. }