Skip to content

Instantly share code, notes, and snippets.

@clonn
Created September 2, 2023 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clonn/651494a55a9f21a62d60d3fc66991b50 to your computer and use it in GitHub Desktop.
Save clonn/651494a55a9f21a62d60d3fc66991b50 to your computer and use it in GitHub Desktop.
fixed nodebb invalid csrf token with cloudflare https config
{
"url": "https://DOMAIN",
"secret": "----",
"database": "mongo",
"mongo": {
"host": "127.0.0.1",
"port": 27017,
"username": "",
"password": "",
"database": "",
"uri": ""
},
"port": "4567",
"socket.io": {
"origins": "*:*"
}
}
server {
listen 80;
server_name DOMAIN;
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 X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
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";
}
}
@clonn
Copy link
Author

clonn commented Sep 2, 2023

this thread saving my time, make a short note.
https://community.nodebb.org/topic/13957/csrf-invalid/4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment