Nginx Proxy Config

Technical Support
  • Hey guys, trying to get NodeBB and Ghost installed on my server, but I seem to be having an issue getting both sites to proxy corrected in the nginx conf file. Can someone that uses both softwares share their conf file?

  • Create a new file in sites-available for each service. Symbolic link them to sites-enabled. Restart the Nginx service and you should be good.

    The node be config can be found in the docs.

    Docs.nodebb.org

  • I have Ghost and NodeBB running from the same config file.

    server {
            listen 80;
    
            server_name blog.bitbangers.co.uk;
    
            location / {
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    proxy_set_header Host $http_host;
                    proxy_set_header X-Forwarded-Proto $scheme;
                    proxy_pass http://127.0.0.1:4568;
            }
    }
    
    server {
            listen 443;
    
            server_name bitbangers.co.uk;
            access_log /log/dir;
    
            ssl on;
            ssl_certificate /ssl/cert/dir;
            ssl_certificate_key /ssl/key/dir;
    
            location / {
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                    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";
            }
    }
    
    
  • As above. You can have them both in the same file. But it's usually easier to debug if your error points to nodebb or ghost. Rather than Both. Copy the above file and have them both listen on port 80 if you're not using SSL/TLS for your chosen subdomain. ( blog.website.com / forum.website.com )


Suggested Topics


| | | |