Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get client IP addresses behind a reverse proxy? #48

Open
BenAHammond opened this issue Dec 25, 2014 · 5 comments
Open

How do I get client IP addresses behind a reverse proxy? #48

BenAHammond opened this issue Dec 25, 2014 · 5 comments
Labels

Comments

@BenAHammond
Copy link

With my Meteor instance behind a reverse proxy (Nginx) the ipAddr is always 127.0.0.1. Any chance you could detect a forwarded port and use that/add it as a new field?

@mizzao
Copy link
Collaborator

mizzao commented Dec 25, 2014

See #23 and http://docs.meteor.com/#/full/meteor_onconnection. You need to set the HTTP_FORWARDED_COUNT environment variable.

This is also mentioned in the README.

@mizzao mizzao changed the title Forwarded IP Support? How do I get client IP addresses behind a reverse proxy? Dec 25, 2014
@BenAHammond
Copy link
Author

I've got that value set and I'm not seeing the correct IP in the
status.lastLogin.upAddr field.

On Wed, Dec 24, 2014 at 9:45 PM, Andrew Mao [email protected]
wrote:

See #23 #23 and
http://docs.meteor.com/#/full/meteor_onconnection.


Reply to this email directly or view it on GitHub
#48 (comment)
.

@mizzao
Copy link
Collaborator

mizzao commented Dec 26, 2014

What do you have that value set to, and how many reverse proxies do you have?

Can you provide an example of the client's full headers from a Meteor.onConnection callback?

This package relies on Meteor's IP address detection, so it's not something that's likely to be an issue with the package.

@BenAHammond
Copy link
Author

Okay then, no worries on fixing it. The value is set to 1 at the moment, as
I'm only behind a single proxy.

On Fri, Dec 26, 2014 at 1:38 PM, Andrew Mao [email protected]
wrote:

What do you have that value set to, and how many reverse proxies do you
have?

Can you provide an example of the client's full headers from a
Meteor.onConnection callback?

This package relies on Meteor's IP address detection, so it's not
something that's likely to be an issue with the package.


Reply to this email directly or view it on GitHub
#48 (comment)
.

@mizzao
Copy link
Collaborator

mizzao commented Dec 26, 2014

Try printing out process.env.HTTP_FORWARDED_COUNT when starting your app to see if you've actually set it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants