Nodebb + nginx + varnish problem

General Discussion
  • #1

    I'm trying to run my first nodebb forum but seem it has some issue with websocket when running with nginx & varnish. net::ERR_EMPTY_RESPONSE

    Im using Centos 6.5 64bit and node v0.10.28, nodebb v4.0.1, nginx 1.6.0

    The following is my config.json:

    "base_url": "",
    "port": "2000",
    "use_port": true,
    "secret": "xxxxxxxx-7c61-f",
    "bind_address": "",
    "database": "mongo",
    "mongo": {
    "host": "",
    "port": "8888",
    "username": "username",
    "password": "password",
    "database": "database"
    "bcrypt_rounds": 12,
    "upload_path": "/public/uploads",
    "relative_path": ""

    And two other config file for nginx, varnish

    Anyone had face this issue? Please help

  • GNU/Linux

    Hi @dolphy -- can you try changing the nginx conf to listen to port 80 instead of 8080? Also change use_port in your config.json to false.

    Maybe that will help...

  • #3

    @julian -- Hi Julian, I did, if nodebb running only with nginx then that problem gone, but anothe issue come up, which is relevant to So its fine. Now I know that Varnish cause this, anyway to figure out why Varnish causing this problem?

  • GNU/Linux

    Not entirely sure... better loop @planner in on this one, as he uses varnish on his instance...

  • #5

    My knowledge of Varnish is very limited - but don't you have to either pipe Varnish into nginx and then NodeBB or nginx into Varnish and then NodeBB? From your configuration, it seems you're trying to pipe nginx into NodeBB on port 2000 and the same for Varnish. Can Varnish and nginx coexist on the same port?

    Here is my working configuration but against, I'm running nginx to Varnish's default port (e.g., 6081).

    server {
        listen 80;
        server_name *;
        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_redirect off;
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";

    For Varnish, I'm just using the default instructions. RHEL 6.5 as well.

Suggested Topics

| | | |