Nginx configuration file for a nodebb forum with http2 enabled
server { | |
server_name forum.mathforu.com; | |
listen 80; | |
return 301 https://\$host\$request_uri; | |
} | |
server { | |
server_name forum.mathforu.com; | |
listen 443 ssl http2; | |
ssl_certificate /etc/nginx/certs/mathforu.bundle.crt; | |
ssl_certificate_key /etc/nginx/certs/mathforu.com.key; | |
location @nodebb { | |
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_pass http://127.0.0.1:4567; | |
proxy_redirect off; | |
# Socket.IO Support | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} | |
location ~ ^/assets/(.*) { | |
root /var/www/mathforu-forum/nodebb/; | |
try_files /build/public/$1 /public/$1 @nodebb; | |
} | |
location /plugins/ { | |
root /var/www/mathforu-forum/nodebb/build/public/; | |
try_files $uri @nodebb; | |
} | |
location / { | |
try_files $uri @nodebb; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment