Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. listen 443 quic;
  5. listen 443 ssl;
  6. listen [::]:443 quic;
  7. listen [::]:443 ssl;
  8. http2 on;
  9. http3 off;
  10. {{ssl_certificate_key}}
  11. {{ssl_certificate}}
  12. server_name www.mywebsite.com;
  13.  
  14. return 301 https://mywebsite.com$request_uri;
  15.  
  16. }
  17.  
  18. server {
  19. listen 80;
  20. listen [::]:80;
  21. listen 443 quic;
  22. listen 443 ssl;
  23. listen [::]:443 quic;
  24. listen [::]:443 ssl;
  25. http2 on;
  26. http3 off;
  27. {{ssl_certificate_key}}
  28. {{ssl_certificate}}
  29. server_name mywebsite.com www1.mywebsite.com;
  30. {{root}}
  31.  
  32. {{nginx_access_log}}
  33. {{nginx_error_log}}
  34.  
  35. if ($scheme != "https") {
  36. rewrite ^ https://$host$request_uri permanent;
  37. }
  38.  
  39. # Redirect with trailing slash to without trailing slash
  40. location ~ ^(.+)/$ {
  41. return 301 $1;
  42. }
  43.  
  44.  
  45.  
  46. location /forum {
  47. proxy_pass http://127.0.0.1:8080; # URL dell'altro sito
  48. proxy_set_header Host $host;
  49. proxy_set_header X-Real-IP $remote_addr;
  50. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  51. proxy_set_header X-Forwarded-Proto $scheme;
  52. }
  53.  
  54. location ~ /.well-known {
  55. auth_basic off;
  56. allow all;
  57. }
  58.  
  59. {{settings}}
  60.  
  61. include /etc/nginx/global_settings;
  62.  
  63. index index.html;
  64.  
  65. location / {
  66. proxy_pass http://127.0.0.1:{{app_port}}/;
  67. proxy_http_version 1.1;
  68. proxy_set_header X-Forwarded-Host $host;
  69. proxy_set_header X-Forwarded-Server $host;
  70. proxy_set_header X-Real-IP $remote_addr;
  71. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  72. proxy_set_header X-Forwarded-Proto $scheme;
  73. proxy_set_header Host $host;
  74. proxy_set_header Upgrade $http_upgrade;
  75. proxy_set_header Connection "Upgrade";
  76. proxy_pass_request_headers on;
  77. proxy_max_temp_file_size 0;
  78. proxy_connect_timeout 900;
  79. proxy_send_timeout 900;
  80. proxy_read_timeout 900;
  81. proxy_buffer_size 128k;
  82. proxy_buffers 4 256k;
  83. proxy_busy_buffers_size 256k;
  84. proxy_temp_file_write_size 256k;
  85. }
  86. }