ffxsam
December 1, 2015, 8:25pm
1
I just now noticed that my app is only seeing one IP from visitors: 172.17.0.1. Apparently this is because it’s running inside a Docker container, which nginx is proxying traffic into. I already have these variables set in the nginx conf:
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
But this makes no difference. Is there something else I need to do to correct this?
shock
December 1, 2015, 8:27pm
2
A what is the problem, cant you access that X-Forwarded-For field in header ?
ffxsam
December 1, 2015, 8:55pm
3
Apparently not? I first noticed this from the mizzao:user-status
package, which pulls in IP address (I believe) from Meteor’s connection object.
ffxsam
December 1, 2015, 8:59pm
4
Aha!
http://docs.meteor.com/#/full/meteor_onconnection
Setting HTTP_FORWARDED_COUNT
to 1 in the environment fixed this!
Did you set the environmental variable via shell on your cloud server or did you simply do it in your Meteor.isServer
statement?