25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 

65 satır
1.6 KiB

  1. # HTTP -> HTTPS 强制跳转
  2. server {
  3. listen 80;
  4. server_name cytx.csybhelp.com;
  5. # ACME HTTP-01 验证路径放行
  6. location /.well-known/acme-challenge/ {
  7. root /home/acme-challenge;
  8. }
  9. # HTTP 跳转 HTTPS
  10. location / {
  11. rewrite ^(.*)$ https://$server_name$1 permanent;
  12. }
  13. }
  14. # HTTPS
  15. server {
  16. listen 443 ssl;
  17. http2 on;
  18. server_name cytx.csybhelp.com;
  19. root /home/www/cytx_api;
  20. access_log /home/wwwlogs/cytx_api_access.log;
  21. error_log /home/wwwlogs/cytx_api_error.log;
  22. ssl_certificate cert/cytx_csybhelp_com_fullchain.pem;
  23. ssl_certificate_key cert/cytx_csybhelp_com_privkey.pem;
  24. ssl_protocols TLSv1.2 TLSv1.3;
  25. ssl_ciphers HIGH:!aNULL:!MD5;
  26. set $node_port 8361;
  27. index index.js index.html index.htm;
  28. # 静态资源直接返回,长缓存
  29. location /static/ {
  30. root /home/www/cytx_api/www;
  31. etag on;
  32. expires max;
  33. }
  34. # 上传文件目录
  35. location /upload/ {
  36. alias /home/www/cytx_api/www/upload/;
  37. etag on;
  38. expires 7d;
  39. }
  40. # 其余请求代理到 Node
  41. location / {
  42. proxy_http_version 1.1;
  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 Host $http_host;
  47. proxy_set_header X-NginX-Proxy true;
  48. proxy_set_header Upgrade $http_upgrade;
  49. proxy_set_header Connection "upgrade";
  50. proxy_pass http://127.0.0.1:$node_port;
  51. proxy_redirect off;
  52. }
  53. }