Forwarding IPs on nginx proxy
-
i have the same problem.. but i can't fix it...
maybe can @a_5mith help ? -
Verify you have
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
in your nginx file in sites-available, if you do, can you paste your nginx file for me to look at (you can remove the site url if you need to (but make it clear if you've used localhost or siteurl.com))
also make sure
use_port
is set tofalse
in your nodebbconfig.json
file. -
@a_5mith There... Maybe I should change
proxy_pass
?server { listen 80; server_name forum.domain.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; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
-
Alright, got it working. So here is the list of things that I tweaked:
"base_url": "http://forum.domain.com"
in NodeBB config.use_port
is set tofalse
in NodeBB config.proxy_pass http://123.456.789.10:4567/;
in nginx config. (so that it matches the droplet's IP)
Copyright © 2024 NodeBB | Contributors