CSRF Error - NodeBB 3.x
-
Hi there,
I have a test forum (3.x) where everything works. Set it up following the instructions (serving using nginx) and its
config.json
looks like:{ "url": "http://forum.beta.....", "secret": "super_secret_xxx", "database": "mongo", "mongo": {... }, "port": [4567,4568,4569], "redis": {... }, "upload_path":"some_upload_path" }
I recently setup HTTPS (using letsencrypt) and since plugins are using the
url
fromconfig.json
, I changed it fromhttp
tohttps
.
Now I cannot login or do anything as it's throwing a CSRF error. I deletedbuild
files andnode_modules
just in case and rebuilt and the issue is still there.
However, when I change theurl
back tohttp
, the issue goes away but this isn't preferable as then the client side is requesting via bothhttp
andhttps
which the browser blocks. I've attached./nodebb log
,config.json
, and login screen with the error.Any help would be appreciated. TIA!
[FYI]:
I have followed instructions but the issue is still there InternalLink, ExternalLink -
Update: It got solved by adding the following in nginx after reading InternalLink.
proxy_set_header X-Forwarded-Proto $scheme;
-
-
Maybe nginx configuration:
have you test to add
proxy_set_header X-Forwarded-Proto $scheme;
to your Nginx configuration?
EDIT: Ha we posted at the same time
-