Page Not Found after login

General Discussion
  • I am using nodebb with nginx, there is always an Not Found error after login, and login is successful.
    WX20190105-220315@2x.png

    The requested address become http://localhost/forum/http://localhost/forum, after login.

    And there is a 404 error console:
    GET http://localhost/forum/api/http://localhost/forum?_=1546743429781 404 (Not Found)

    In config file of nginx:

    server {
        listen 80;
    
        location /forum {
            proxy_pass http://localhost:4567/forum/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    And in config.json:

    {
        "url": "http://localhost:4567/forum/",
        "secret": "xxxxx-xxxxx-xxxx-xxx-xxxx",
        "database": "mongo",
        "port": "4567",
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
        }
    }
    
  • Try one or both of the following:

    • removing the trailing slashes in config.json and your nginx config
    • changing proxy_pass http://localhost:4567/forum/; to proxy_pass http://localhost:4567
  • Hi, im getting the same error. this is my config.json:

    {
        "url": "http://foro.az-rp.com:4567",
        "secret": "93dbf148-f817-47f9-996c-4f87672d9787",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "0"
        },
        "port": "4567"
    }
    
    

    and my nginx config:

      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";
      }
    
    
  • @byAppeL look in your browser address bar. Are you accessing the site at http://foro.az-rp.com:4567? My guess is that the port (:4567) does not show up in your address bar, and you're accessing the site at one of the default ports. In that case, remove the :4567 from the url value in config.json.

    I don't know how many times I'll have to say this, but the url value in config.json should be set to exactly the url at which you access your site. The protocol, domain, path, and port should all be identical to what you see in the address bar of your browser.


Suggested Topics