403 forbidden - Permission denied

Unsolved Technical Support
  • I have a successful nodebb setup working with my IP at http://5.35.243.92:4567.

    When I try to access the forum with the generic hostname (http://lvps5-35-243-92.dedicated.hosteurope.de:4567) though, I get

    Looks like your connection to NodeBB was lost, please wait while we try to reconnect."
    

    Very similar to this problem:
    https://community.nodebb.org/topic/10396/connection-lost

    When going to the login page and trying to log in, upon hitting the "Submit" button, I get:

    Login failed.
    Your login was not successful. Your session might have expried. Please try again.
    

    (freely translated from German)

    So I recon my problem is happening somewhere in the nodebb config.

    My working config is:

    {
        "url": "http://5.35.243.92:4567",
        "secret": "d68e...",
        "database": "redis",
        "port": [
            "4567",
            "4568",
            "4569"
        ],
        "redis": {
         "host": "127.0.0.1",
        "port": "6379",
        "database": "0"
        }
    }
    

    So now I would like to do this:

    {
        "url": "http://lvps5-35-243-92.dedicated.hosteurope.de:4567",
        "secret": "d68e2..."
    }
    

    After stopping and starting nodebb, I browse to
    http://lvps5-35-243-92.dedicated.hosteurope.de:4567/
    And I get 403 forbidden - Permission denied when trying to login with my credentials.

    And the website reports the same problem as above:

    Login failed [...] Session expired.
    

    The log entry for the login request seems to be:

    2017-12-10 16:23:11	Error	31.16.249.122	403	POST /login?error=csrf-invalid HTTP/1.1
    

    Any ideas are greatly appreciated.

    edit:
    Ultimately I will need the forum to run with the actual domain: https://schreibnacht.de

    So instead of getting it to run with the generic hostname, making it work with the schreibnacht domain would be even more appreciated.

    For the schreibnacht.de domain I get:

    /index.html Not found
    This page does not exist. Return to homepage.
    

    When browsing to https://schreibnacht.de/
    And a

    This site can’t be reached
    schreibnacht.de unexpectedly closed the connection.
    ERR_CONNECTION_CLOSED
    

    When browsing to https://schreibnacht.de:4567

    With the nodebb configuration

    {
        "url": "https://schreibnacht.de",
        "secret": "d68e...",
        "database": "redis",
        "port": [
            "4567",
            "4568",
            "4569"
        ],
        "redis": {
         "host": "127.0.0.1",
        "port": "6379",
        "database": "0"
        }
    }
    

    And an nginx proxy configured like this:

    location / {
        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";
    }
    

    Although the domain points to the same server as http://lvps5-35-243-92.dedicated.hosteurope.de. Shouldn't that mean that http://schreibnacht.de:4567 should deliver the same as http://lvps5-35-243-92.dedicated.hosteurope.de:4567?
    Considering they should both not be picked up by the nginx because they use the open port directly?

    Curiously, going to http://5.35.243.92:4567/ (IP directly with nodebb configured to "url": "https://schreibnacht.de") with this configuration, the page still shows up and does't display the "/index.html not found" problem. But it does report "You've been disconnected, please wait while we reconnect you."

  • Its likely NGINX related issue. I have dropped you a PM 😉

    For the others. If OP decides to sort this with me, we will share the results here of course.

  • We found the solution after quite a war of versions 😄

    The problem was that the server has Plesk installed. Plesk has runs Apache as the primary webserver but can put an Nginx-Proxy in between, which I wanted to use as a proxy to my nodebb setup as well.

    Turns out though that Plesk installs an Nginx 1.11.

    In the requirements on Github it is stated that NodeBB requires Nginx 1.3.13 to run (Github - Nodebb - requirements), so 1.11 seemed feasible.

    Turns out, it wasn't. After fiddling around with it for over 15 hours, I decided to kick Plesks webserver management, dumped Apache, compiled Nginx from source to get 1.13.7 and retried everything. It worked without any problems.

    Thus I am somewhat assuming that NodeBB really requires 1.13.3 to run and not 1.3.13.

    The right Nginx version fixed the problem 😃
    I am assuming problems with the proxy-functionality with websockets.

    Can anyone confirm my suspicion about the version missmatch in the docs?

  • @worp1900 At least 1.3.13 is required due to this changelog: http://nginx.org/en/CHANGES

    The websocket changes in there are required. Not quite sure why your install didn't with with 1.11, though NodeBB has worked fine with Nginx ever since then with no problems 😸


Suggested Topics


  • 0 Votes
    11 Posts
    386 Views

    @baris oh right

  • 1 Votes
    1 Posts
    182 Views

    Hi,

    Is there a way that our moderator/super moderator can create category and sub-category ?

  • WebSocket 403 Errors

    Technical Support
    0 Votes
    3 Posts
    2k Views

    You must set the url value in config.json to the URL at which you access your site.

  • 0 Votes
    8 Posts
    5k Views

    I got this error when didn't apply x-csrf-token header to the request. Is there any custom requests?
    It should be done like this: https://github.com/NodeBB/NodeBB/blob/master/public/src/client/login.js#L28

  • 1 Votes
    1 Posts
    1k Views

    Hi guys!

    I have previous 0.5.0-2 version of forum on Heroku. It works fine. When I updated NodeBB to 0.6.1 version it crashed with error. Any ideas?

    2015-04-30T06:31:05.151177+00:00 heroku[web.1]: State changed from crashed to starting
    2015-04-30T06:31:12.946261+00:00 heroku[web.1]: Starting process with command npm start
    2015-04-30T06:31:16.159469+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
    2015-04-30T06:31:16.159494+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
    2015-04-30T06:31:16.817884+00:00 app[web.1]:
    2015-04-30T06:31:16.817890+00:00 app[web.1]: > [email protected] start /app
    2015-04-30T06:31:16.817892+00:00 app[web.1]: > ./nodebb start
    2015-04-30T06:31:16.817893+00:00 app[web.1]:
    2015-04-30T06:31:16.854535+00:00 app[web.1]: sh: 1: ./nodebb: Permission denied
    2015-04-30T06:31:16.873738+00:00 app[web.1]: npm ERR! Linux 3.13.0-49-generic
    2015-04-30T06:31:16.878037+00:00 app[web.1]: npm ERR! code ELIFECYCLE
    2015-04-30T06:31:16.878041+00:00 app[web.1]: npm ERR! [email protected] start: ./nodebb start
    2015-04-30T06:31:16.878043+00:00 app[web.1]: npm ERR! Exit status 126
    2015-04-30T06:31:16.878044+00:00 app[web.1]: npm ERR!
    2015-04-30T06:31:16.878046+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script './nodebb start'.
    2015-04-30T06:31:16.878048+00:00 app[web.1]: npm ERR! This is most likely a problem with the nodebb package,
    2015-04-30T06:31:16.878049+00:00 app[web.1]: npm ERR! not with npm itself.
    2015-04-30T06:31:16.878050+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
    2015-04-30T06:31:16.878052+00:00 app[web.1]: npm ERR! ./nodebb start
    2015-04-30T06:31:16.878054+00:00 app[web.1]: npm ERR! You can get their info via:
    2015-04-30T06:31:16.878693+00:00 app[web.1]: npm ERR! npm owner ls nodebb
    2015-04-30T06:31:16.878696+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
    2015-04-30T06:31:16.889120+00:00 app[web.1]:
    2015-04-30T06:31:16.899848+00:00 app[web.1]: npm ERR! /app/npm-debug.log
    2015-04-30T06:31:16.866363+00:00 app[web.1]:
    2015-04-30T06:31:16.874577+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
    2015-04-30T06:31:16.875101+00:00 app[web.1]: npm ERR! node v0.12.2
    2015-04-30T06:31:16.876089+00:00 app[web.1]: npm ERR! npm v2.7.4
    2015-04-30T06:31:16.897668+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
    2015-04-30T06:31:17.925842+00:00 heroku[web.1]: Process exited with status 1
    2015-04-30T06:31:17.938969+00:00 heroku[web.1]: State changed from starting to crashed