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

Technical Support
  • The following is my nodebb config.

    {
        "url": "https://www.ygnconnect.com",
        "secret": "839fa2da-d222-4d68-94a0-a9e07efe2ef5",
        "database": "mongo",
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
            "username": "user",
            "password": "pass",
            "database": "db"
        }
    }
    

    And the following is my nginx config

    ### redirects http requests to https
    server {
        listen 80;
    
        server_name ygnconnect.com www.ygnconnect.com;
        return 301 https://www.ygnconnect.com$request_uri;
    
        return 302 https://$server_name$request_uri;
    }
    
    ### the https server
    server {
        # listen on ssl, deliver with speedy if possible
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
    
        server_name ygnconnect.com www.ygnconnect.com;
    
        if ($host = 'ygnconnect.com' ) {
                rewrite ^ https://www.ygnconnect.com$request_uri;
        }
    
        # change these paths!
        ssl_certificate /etc/letsencrypt/live/www.ygnconnect.com/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/www.ygnconnect.com/privkey.pem; # managed by Certbot
    
        # enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated.
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
    
        location ~ /.well-known {
            allow all;
        }
    
       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 https://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";
        }
    
    }
    

    Is there any idea why I am in trouble?

  • When I check the console, it show like the following

    Failed to load resource: the server responded with a status of 403 ()
    /socket.io/?EIO=3&transport=polling&t=L-PoHUg
    
  • The common causes for a session mismatch error are usually one of the following:

    1. Mis-configured URL parameter in your config.json file

    If you have a misconfigured url value in your config.json file, the cookie may be saved incorrectly (or not at all), causing a session mismatch error. Please ensure that the link you are accessing your site with and the url defined match.

    2. Improper/malformed cookieDomain set in ACP

    Sometimes admins set this value without realising that they probably don't need to set it at all. The default is perfectly fine. This is what the config looks like:

    Cookie Domain setting

    If this is set, you'll want to revert the setting by editing your database directly:

    Redis: hdel config cookieDomain
    MongoDB: db.objects.update({ _key: "config" }, { $set: "cookieDomain": "" });

    3. Missing X-Forwarded-Proto header from nginx/apache

    If you are using a reverse proxy, you will need to have nginx pass a header through to NodeBB so it correctly determines the correct cookie secure property.

    In nginx, you will need to add the directive like so:

    location / {
        ...
        proxy_set_header X-Forwarded-Proto $scheme;
        ...
    }
    
  • This post is deleted!

Suggested Topics


  • 0 Votes
    10 Posts
    795 Views

    @nullpointer said in Connecting to socket endpoint from a custom frontend:

    var socket = io('https://dev-forum.domain.io', { transport: ["polling", "websocket"], path: "/socket.io/", extraHeaders: { withCredentials: true, cookie: 'express.sid=s%3Am0UuuyatTTSajjAnI5gGSukaJSHJaiKpIVhb3H7L.TW4c4vZn4blOnWV1gilF9HhMqFc9g9V7NnLLZHMAmFg; Domain=dev-forum.domain.io; Path=/; HttpOnly; SameSite=Lax', }, });

    withCredentials is not a header - it's an option that should be on the same level in the settings object as extraHeaders. It should be used instead of setting the cookie header manually in the browser - but it will only work if the browser has the cookies for the website you're connecting to and needs explicit permission from it via headers (the Access-Control-Allow-* headers).
    This should look more like this:

    var socket = io('https://dev-forum.domain.io', { transport: ["polling", "websocket"], path: "/socket.io/", withCredentials: true, });

    The reason the NodeBB test example works is that it's not ran inside a browser - NodeJS, as a server environment, has quite different security requirements than browsers and also just can't save credentials for each page (imagine what programming horror having this kind of mutable state in code would be...). I'm not sure what is your ultimate goal with this code, so that's why I mentioned the cookies as needed for server-side code.

  • 0 Votes
    11 Posts
    437 Views

    @josef
    far fa-pencil-ruler is a paid icon (the solid version is free). Free parts of the regular pack work just fine - see https://fontawesome.com/v5/search?m=free&s=regular for a list of them. It's much more limited than the solid free pack though (151 icons vs 1001), so that's probably why you ran into this problem so easily.

    The only issue that you might run into if you're using a version before v2.2.0 is that fab class conflicts with another class in Persona theme turning all brand icons into action buttons, but this is resolved in current versions of Persona.

    If you have a paid version of FA5 it should be fairly simple to use it instead - you'd need to replace the FA files in public/vendor/fontawesome with the new ones, set fa-font-path to vendor/fontawesome/webfonts in _variables.less and import the light and duotone less files in src/meta/css.js.

    Also, I wanted to add that FA6 is slated to be added in NodeBB 3.0 (it's waiting until a major release since icon style being changed is possibly breaking) https://github.com/NodeBB/NodeBB/pull/10701

  • 0 Votes
    17 Posts
    2k Views

    @Apollo what was the issue?

  • 3 Votes
    5 Posts
    3k Views

    @a_5mith said in Recommand: Attracting developers and end users to nodeBB:

    are we explaining what each individual hook is for,

    It would be nice if each individual hook was more explained. A lot of try and fail now + google 😛

  • 2 Votes
    34 Posts
    25k Views

    Very Good but HapHost is very very BAD.
    NodeBB don't work.
    128 Mb of RAM are to few.
    Already installing plugins the site crash, because VPS arrives at the maximum of RAM.
    OMG. Very Bad.

    Without do NOTHING.
    RAM : http://i.gyazo.com/2b0fcbb3c8a36dd3d0b40199393c59c3.png
    CPU : http://i.gyazo.com/33656ee25ef23e9fec43dce06458caaa.png

    FUCK.