New install leaves me with session mismatch + invalid csrf
-
I get these errors either through the Nginx proxy I have in front of it (on another VM)
or direct local IP http://10.254.0.35:4567
-
New VM and used Node 4.6.2 and NodeBB 1.x.x (which now pulls 1.4.0)
Same problems.
There has to be something else causing the problem.
So any ideas on where I can look to track it down.
Again, I followed these instructions (that I wrote based on the official docs): https://mangolassi.it/topic/11695/installing-nodebb-with-mongo-on-centos-7
-
Seems like similar error which I've been experiencing lately (although I'm not using CentOs): https://community.nodebb.org/topic/9886/invalid-csrf-token/3
Perhaps we can figure it out together. Have you tried using older version like 1.1.2?
-
I am seeing the same issue here. I have tried 1.4.0 with both Node 7.2.1 and 6.9.2 on a Ubuntu VM with Redis.
The problem seems to be with the url. NodeBB does not seem to like https://domain.com url. It worked fine when I reverted back to the default http://localhost:4567 but using the localhost URL means assets required by plugins such as emoji are not serving correctly.
This seems to be a pretty critical bug. Any way to prioritize a fix for it?
Thank you!
-
What are you using for your url in
config.json
? -
This is the value of url I was trying to use: "url": "https://forums.coinfetch.com".
-
We're using Nginx. Here is the config
upstream io_nodes { ip_hash; server 127.0.0.1:4567; server 127.0.0.1:4568; server 127.0.0.1:4569; server 127.0.0.1:4570; } server { listen 80; server_name forums.coinfetch.com; charset utf-8; location /health_check { proxy_next_upstream error; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://io_nodes; break; } proxy_next_upstream error; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; if ($http_x_forwarded_proto != "https") { return 301 https://$host$request_uri; } # Socket.IO Support proxy_http_version 1.1; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; gzip on; gzip_comp_level 5; gzip_min_length 1000; gzip_proxied any; gzip_types *; location @nodebb { proxy_pass http://io_nodes; } location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) { root /var/www/coinfetchbb/; try_files $uri $uri/ @nodebb; } location / { proxy_pass http://io_nodes; } add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;"; }
-
Are you running the server behind an AWS load balancer?
-
@tin If your load balancer terminates SSL and proxies the connection to nginx (and NodeBB) as http, then nginx is telling NodeBB that the protocol is HTTP when it should be HTTPS.
proxy_set_header X-Forwarded-Proto $scheme;
Change this to
https
and try again? -
I have never gotten this new install to work. It is extremely frustrating.
I have an older install, that is on 1.2 or 1.3, that I upgrade to 1.4.0 and it started having the same problems, so I reverted to the snapshot I had made of that VM prior to upgrading.
I am going to delete the new VM and start over one more time.
-
So I have the site working. I did not have this line in my Nginx config. My Nginx is on a different host, not the same one.
proxy_set_header X-Forwarded-Proto $scheme;
But I have never had it and the previous existing sites have worked.
It also does not explain why I received the error on the existing install after an upgrade from 1.3.0 to 1.4.0
-
@JaredBusch That's a new requirement -- surprised we didn't catch that it was missing in your config earlier
-
@JaredBusch said in New install leaves me with session mismatch + invalid csrf:
proxy_set_header X-Forwarded-Proto $scheme;
server { listen 80; server_name www.docfindy.com; location / { 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_pass http://127.0.0.1:4567/; proxy_redirect off; proxy_set_header X-Forwarded-Proto $scheme; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { listen 80; server_name docfindy.com; return 301 http://www.docfindy.com$request_uri; }
I am using Mongo 3.2 and Nodebb 1.4.2, this is my nginx config file, session mismatch still present, plaase help.
@JaredBusch @julian -
@Pramvir-Rathee here is my current Nginx config for the site.
server { client_max_body_size 40M; listen 443 ssl; server_name community.bundystl.com; ssl on; ssl_certificate /etc/letsencrypt/live/bundystl.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/bundystl.com/privkey.pem; ssl_stapling on; ssl_stapling_verify on; ssl_protocols TLSv1.2 TLSv1.1 TLSv1; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_dhparam /etc/ssl/certs/dhparam.pem; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; 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://10.254.0.35:4567; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } server { client_max_body_size 40M; listen 80; server_name community.bundystl.com; rewrite ^ https://$server_name$request_uri? permanent; }