Skip to content

Instantly share code, notes, and snippets.

Created December 7, 2017 12:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Nginx configuration file for a nodebb forum with http2 enabled
server {
listen 80;
return 301 https://\$host\$request_uri;
server {
listen 443 ssl http2;
ssl_certificate /etc/nginx/certs/mathforu.bundle.crt;
ssl_certificate_key /etc/nginx/certs/;
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_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