Advertisement
Guest User

Untitled

a guest
Jan 17th, 2022
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. upstream io_nodes {
  2. ip_hash;
  3. server 127.0.0.1:4567;
  4. server 127.0.0.1:4568;
  5. server 127.0.0.1:4569;
  6. server 127.0.0.1:4570;
  7. }
  8.  
  9.  
  10. ### redirects http requests to https
  11. server {
  12. listen 80;
  13. server_name forum.com www.forum.com;
  14.  
  15. return 302 https://$server_name$request_uri;
  16. }
  17.  
  18. server {
  19.  
  20. listen 443 default_server ssl http2; # managed by Certbot
  21.  
  22. ssl_certificate /etc/letsencrypt/live/forum.com/fullchain.pem; # managed by Certbot
  23. ssl_certificate_key /etc/letsencrypt/live/forum.com/privkey.pem; # managed by Certbot
  24. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  25. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  26.  
  27.  
  28. server_name forum.com www.forum.com;
  29. client_max_body_size 100M;
  30. root /var/www/forum.com;
  31. index index.php index.html index.htm;
  32.  
  33. access_log off;
  34. error_log /dev/null;
  35.  
  36. proxy_set_header X-Real-IP $remote_addr;
  37. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  38. proxy_set_header X-Forwarded-Proto $scheme;
  39. proxy_set_header Host $http_host;
  40. proxy_set_header X-NginX-Proxy true;
  41.  
  42. proxy_redirect off;
  43.  
  44. # Socket.IO Support
  45. proxy_http_version 1.1;
  46. proxy_set_header Upgrade $http_upgrade;
  47. proxy_set_header Connection "upgrade";
  48.  
  49. gzip on;
  50. gzip_min_length 1000;
  51. gzip_proxied off;
  52. gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
  53.  
  54. location @nodebb {
  55. proxy_pass http://io_nodes;
  56. }
  57.  
  58. location ~ ^/assets/(.*) {
  59. root /home/fsuzer/nodebb/;
  60. try_files /build/public/$1 /public/$1 @nodebb;
  61. }
  62.  
  63. location /forum/plugins/ {
  64. root /home/fsuzer/nodebb/build/public/;
  65. try_files $uri @nodebb;
  66. }
  67.  
  68. location /forum/ {
  69. proxy_pass http://io_nodes;
  70. }
  71.  
  72. location / {
  73. try_files $uri $uri/ /index.php$is_args$args;
  74. }
  75.  
  76. location ~ .php$ {
  77. include snippets/fastcgi-php.conf;
  78. fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  79. }
  80.  
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement