Casnode runs behind Nginx with TLS. Everything works, but the admin pages show 127.0.0.1 as the IP of everyone. What am I missing?
Turn on trustProxyHeader = true in conf/app.local.conf, so that Casnode takes the client IP from X-Forwarded-For, and make sure Nginx sets it:
location / {
proxy_pass http://127.0.0.1:16900;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Only proxy to httpport. The Next.js server on httpport + 1 listens on 127.0.0.1 and gets its requests through the Go backend.
Leave trustProxyHeader off when nothing is in front of Casnode, otherwise anyone could pick their own IP with that header.
Join the conversation
Sign up to reply, like and follow topics.
Suggested Topics
Want to read more? Browse other topics in Configuration or view latest topics.
1 / 2
Oct 27
