forum_dev_warage_win 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # ./acme.sh --issue --standalone --httpport 9999 -d forum_dev.warage.win --certpath /etc/letsencrypt/live/forum_dev.warage.win/cert.pem --keypath /etc/letsencrypt/live/forum_dev.warage.win/privkey.pem --fullchainpath /etc/letsencrypt/live/forum_dev.warage.win/fullchain.pem;
  2. # --force
  3. #server{
  4. # listen 80;
  5. # server_name forum_dev.warage.win;
  6. # include acme_http;
  7. #}
  8. #server{
  9. # listen 80;
  10. # server_name forum_dev.warage.win;
  11. # return 301 https://forum_dev.warage.win$request_uri;
  12. #}
  13. ## because cert by cloudflare
  14. server{
  15. #listen 443 ssl http2;
  16. listen 80;
  17. root /var/www/forum_dev;
  18. index index.php index.html;
  19. server_name forum_dev.warage.win;
  20. #ssl_certificate /etc/letsencrypt/live/forum_dev.warage.win/fullchain.pem;
  21. #ssl_certificate_key /etc/letsencrypt/live/forum_dev.warage.win/privkey.pem;
  22. #ssl_dhparam /etc/letsencrypt/live/forum_dev.warage.win/dhparams.pem;
  23. #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  24. #ssl_prefer_server_ciphers on;
  25. #ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
  26. #ssl_session_timeout 10m;
  27. #add_header Strict-Transport-Security "max-age=31536000;";
  28. charset utf-8;
  29. underscores_in_headers on;
  30. access_log /var/www/ok_forum_dev_warage_win.log;
  31. error_log /var/www/err_forum_dev_warage_win.log;
  32. gzip on;
  33. gzip_vary on;
  34. gzip_comp_level 6;
  35. gzip_min_length 1024;
  36. gzip_proxied any;
  37. gzip_types text/plain text/css image/svg+xml image/svg application/json application/javascript application/x-javascript text/*;
  38. gzip_buffers 16 8k;
  39. #add_header X-Frame-Options "DENY";
  40. location ~* \.tpl$ { access_log off; error_log off; return 403; }
  41. location ~* \.sql$ { access_log off; error_log off; return 403; }
  42. location /css/ {
  43. root /var/www/forum_dev_warage_win/stc;
  44. try_files $uri $uri/ =404;
  45. expires max;
  46. access_log off;
  47. error_log off;
  48. }
  49. location /js/ {
  50. root /var/www/forum_dev_warage_win/stc;
  51. try_files $uri $uri/ =404;
  52. expires max;
  53. access_log off;
  54. error_log off;
  55. }
  56. location /img/ {
  57. root /var/www/forum_dev_warage_win/stc;
  58. try_files $uri $uri/ =404;
  59. expires max;
  60. access_log off;
  61. error_log off;
  62. }
  63. # ws
  64. location /ws {
  65. access_log off;
  66. proxy_pass http://127.0.0.1:5000;
  67. proxy_http_version 1.1;
  68. proxy_set_header Upgrade $http_upgrade;
  69. proxy_set_header Connection "upgrade";
  70. proxy_read_timeout 86400s;
  71. proxy_send_timeout 86400s;
  72. proxy_set_header HOST $host; # $http_host
  73. proxy_set_header X-Real-IP $remote_addr;
  74. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  75. }
  76. location / {
  77. ##try_files $uri $uri/ =404;
  78. try_files $uri $uri/ @python;
  79. ##try_files @python @python;
  80. ##try_files $uri @python @python;
  81. access_log off;
  82. }
  83. location @python {
  84. proxy_set_header HOST $host;
  85. proxy_set_header X-Real-IP $remote_addr;
  86. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  87. proxy_set_header Host $http_host;
  88. proxy_pass http://127.0.0.1:5000;
  89. }
  90. }