Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream io_nodes {
- ip_hash;
- server 127.0.0.1:4567;
- server 127.0.0.1:4568;
- server 127.0.0.1:4569;
- server 127.0.0.1:4570;
- }
- ### redirects http requests to https
- server {
- listen 80;
- server_name forum.com www.forum.com;
- return 302 https://$server_name$request_uri;
- }
- server {
- listen 443 default_server ssl http2; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/forum.com/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/forum.com/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
- server_name forum.com www.forum.com;
- client_max_body_size 100M;
- root /var/www/forum.com;
- index index.php index.html index.htm;
- access_log off;
- error_log /dev/null;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header Host $http_host;
- proxy_set_header X-NginX-Proxy true;
- proxy_redirect off;
- # Socket.IO Support
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- gzip on;
- gzip_min_length 1000;
- gzip_proxied off;
- gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
- location @nodebb {
- proxy_pass http://io_nodes;
- }
- location ~ ^/assets/(.*) {
- root /home/fsuzer/nodebb/;
- try_files /build/public/$1 /public/$1 @nodebb;
- }
- location /forum/plugins/ {
- root /home/fsuzer/nodebb/build/public/;
- try_files $uri @nodebb;
- }
- location /forum/ {
- proxy_pass http://io_nodes;
- }
- location / {
- try_files $uri $uri/ /index.php$is_args$args;
- }
- location ~ .php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement