403 forbidden - Permission denied



  • 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

    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?


  • Admin

    @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 😸


 


Star

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