Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Tech
  3. Re: Unable to log in after turning off cloudflare proxy

Re: Unable to log in after turning off cloudflare proxy

Scheduled Pinned Locked Moved Tech
9 Posts 3 Posters 75 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bh4-tech@community.nodebb.orgB This user is from outside of this forum
    bh4-tech@community.nodebb.orgB This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #1

    @baris Not related to this, but I am also facing a problem due to csrf token. I earlier used cloudflare SSL on my nodebb instance but now have turned it off because it was giving issues with loading media for federated accounts. My account was auto logged off and now I cannot login. Everytime I try to login, I get the error "Login Unsuccessful
    We were unable to log you in, likely due to an expired session. Please try again" and the url bar shows

    /login?error=csrf-invalid
    

    This happens both for admin as well as non-admin user. I have turned on-off-on as well as restarted both nodebb and nginx but the problem remains. Any suggested solution?

    1 Reply Last reply
    0
    • baris@community.nodebb.orgB This user is from outside of this forum
      baris@community.nodebb.orgB This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #2

      Couple things to check.

      1. Make sure url in config.json is same as the url you use to access the site.
      2. Make sure your load balancer is configured properly for ssl.
      1 Reply Last reply
      0
      • julian@community.nodebb.orgJ This user is from outside of this forum
        julian@community.nodebb.orgJ This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #3

        Can you try in incognito, and see whether that works? If so, then you need to clear all of your session cookies on your main browser session.

        1 Reply Last reply
        0
        • bh4-tech@community.nodebb.orgB This user is from outside of this forum
          bh4-tech@community.nodebb.orgB This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #4

          @julian Same problem in incognito also.

          1 Reply Last reply
          0
          • bh4-tech@community.nodebb.orgB This user is from outside of this forum
            bh4-tech@community.nodebb.orgB This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #5

            @baris Point 1 is checked. I think the problem is with nginx(point 2). Sharing my nginx conf file because I could not figure out the problem.

            upstream io_nodes {
                ip_hash;
                server 127.0.0.1:4567;
                server 127.0.0.1:4568;
            }
            
            server {
            
                server_name ekk.app;
            
                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";
            
                gzip            on;
                gzip_min_length 1000;
                gzip_proxied    off;
                gzip_types      text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
            
                location [@nodebb](https://community.nodebb.org/user/nodebb) {
                    proxy_pass http://io_nodes;
                }
            
                location ~ ^/assets/(.*) {
                    root /home/debian/nodebb/;
                    try_files /build/public/$1 /public/$1 [@nodebb](https://community.nodebb.org/user/nodebb);
                }
            
                location / {
                    proxy_pass http://io_nodes;
                }
            
                listen 443 ssl; # managed by Certbot
                ssl_certificate /etc/letsencrypt/live/ekk.app/fullchain.pem; # managed by Certbot
                ssl_certificate_key /etc/letsencrypt/live/ekk.app/privkey.pem; # managed by Certbot
                include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
                ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
            
            }
            
            
            server {
                if ($host = ekk.app) {
                    return 301 https://$host$request_uri;
                } # managed by Certbot
            
            
                listen 80;
            
                server_name ekk.app;
                return 404; # managed by Certbot
            
            
            }
            
            
            1 Reply Last reply
            0
            • baris@community.nodebb.orgB This user is from outside of this forum
              baris@community.nodebb.orgB This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #6

              Try adding proxy_set_header X-Forwarded-Proto $scheme; after proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

              bh4-tech@community.nodebb.orgB 1 Reply Last reply
              0
              • baris@community.nodebb.orgB [email protected]

                Try adding proxy_set_header X-Forwarded-Proto $scheme; after proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                bh4-tech@community.nodebb.orgB This user is from outside of this forum
                bh4-tech@community.nodebb.orgB This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #7

                @baris You are a wizard!!! That really solved the issue.

                baris@community.nodebb.orgB 1 Reply Last reply
                0
                • bh4-tech@community.nodebb.orgB [email protected]

                  @baris You are a wizard!!! That really solved the issue.

                  baris@community.nodebb.orgB This user is from outside of this forum
                  baris@community.nodebb.orgB This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #8

                  @bh4-tech Not really, it's from our docs here https://docs.nodebb.org/configuring/proxies/nginx/#basic-with-ssl 😆

                  bh4-tech@community.nodebb.orgB 1 Reply Last reply
                  0
                  • baris@community.nodebb.orgB [email protected]

                    @bh4-tech Not really, it's from our docs here https://docs.nodebb.org/configuring/proxies/nginx/#basic-with-ssl 😆

                    bh4-tech@community.nodebb.orgB This user is from outside of this forum
                    bh4-tech@community.nodebb.orgB This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #9

                    @baris Yeah noticed it now. Actually, I also setup the nginx configuration following nodebb docs, specially the one for utilising multiple(2) cores for nodebb, but somehow missed the line related to protocol. Thanks a lot again.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups