nginx-default.internal.conf 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. server {
  2. listen 80 default_server;
  3. server_name _;
  4. # Public HTTP is redirect-only. Never serve pages or proxy application traffic over plaintext.
  5. return 308 https://$host$request_uri;
  6. }
  7. server {
  8. listen 443 ssl default_server;
  9. http2 on;
  10. ssl_certificate /etc/nginx/certs/gzhxtc.edu.cn/server.crt;
  11. ssl_certificate_key /etc/nginx/certs/gzhxtc.edu.cn/server.key;
  12. ssl_protocols TLSv1.2 TLSv1.3;
  13. ssl_ciphers HIGH:!aNULL:!MD5;
  14. ssl_session_cache shared:SSL:10m;
  15. ssl_session_timeout 1d;
  16. ssl_session_tickets off;
  17. server_name _;
  18. client_max_body_size 1200m;
  19. client_body_timeout 1800s;
  20. # Report-only first: the legacy JSP pages still rely on inline scripts.
  21. # Legacy Vue's full build uses eval; keep this only in report-only until it is replaced.
  22. add_header Content-Security-Policy-Report-Only "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://answer.eol.cn https://robot.chaoxing.com https://wpa.b.qq.com; object-src 'none'; base-uri 'self'; frame-ancestors 'self';" always;
  23. add_header X-Content-Type-Options nosniff always;
  24. add_header Referrer-Policy strict-origin-when-cross-origin always;
  25. add_header X-Frame-Options SAMEORIGIN always;
  26. location ~ ^/web/subassembly/.*/backup/ {
  27. return 404;
  28. }
  29. # No PHP runtime exists in this stack. Deny PHP-family files globally as defense in depth.
  30. location ~* \.(php|phtml|phar)$ {
  31. return 404;
  32. }
  33. # vConsole sample pages are not application assets and must never be public.
  34. location ^~ /apps/space/plug-in/vConsole-3.3.4/example/ {
  35. return 404;
  36. }
  37. location = /apps/workbench {
  38. return 302 /apps/workbench/;
  39. }
  40. location / {
  41. proxy_pass http://172.17.0.1:8080;
  42. proxy_set_header Host $host;
  43. proxy_set_header X-Real-IP $remote_addr;
  44. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  45. proxy_set_header X-Forwarded-Proto $scheme;
  46. proxy_set_header X-Forwarded-Port $server_port;
  47. proxy_set_header X-Forwarded-Host $host;
  48. proxy_connect_timeout 60s;
  49. proxy_send_timeout 1800s;
  50. proxy_read_timeout 1800s;
  51. }
  52. }