You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

51 line
1.3 KiB

  1. # HTTP -> HTTPS 强制跳转
  2. server {
  3. listen 80;
  4. server_name wk.aionline.cc;
  5. return 301 https://$host$request_uri;
  6. }
  7. # HTTPS
  8. server {
  9. listen 443 ssl;
  10. http2 on;
  11. server_name wk.aionline.cc;
  12. root /home/www/pap_web/www;
  13. ssl_certificate /etc/nginx/ssl/wk.aionline.cc.pem;
  14. ssl_certificate_key /etc/nginx/ssl/wk.aionline.cc.key;
  15. ssl_protocols TLSv1.2 TLSv1.3;
  16. ssl_ciphers HIGH:!aNULL:!MD5;
  17. set $node_port 8361;
  18. index index.js index.html index.htm;
  19. # 静态资源直接返回,长缓存
  20. location ~ /static/ {
  21. etag on;
  22. expires max;
  23. }
  24. # 上传文件目录
  25. location /upload/ {
  26. alias /home/www/pap_web/www/upload/;
  27. etag on;
  28. expires 7d;
  29. }
  30. # 其余请求代理到 Node
  31. location / {
  32. proxy_http_version 1.1;
  33. proxy_set_header X-Real-IP $remote_addr;
  34. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  35. proxy_set_header X-Forwarded-Proto $scheme;
  36. proxy_set_header Host $http_host;
  37. proxy_set_header X-NginX-Proxy true;
  38. proxy_set_header Upgrade $http_upgrade;
  39. proxy_set_header Connection "upgrade";
  40. proxy_pass http://127.0.0.1:$node_port;
  41. proxy_redirect off;
  42. }
  43. }