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

Incorrect IP address detected on nginx reverse proxy (Bluehost VPS hosting) #3036

Closed
rachelrine opened this issue Jun 27, 2018 · 2 comments
Closed

Comments

@rachelrine
Copy link

Description

Found reference to this issue here.

Solution

Was able to fix the issue by manually removing line 55.

Needed

Looking for a way to specify this in the admin, so the manual fix doesn't get overwritten on update.

@davist11
Copy link
Contributor

This change now prevents the correct IP from being returned and 127.0.0.1 is returned

brandonkelly added a commit that referenced this issue Jul 30, 2018
@brandonkelly
Copy link
Member

Yeah looking at the Wikipedia article for X-Forwarded-For, looks like it is in fact meant to represent the client’s IP.

@rachelrine It sounds like your server is the one that is misusing the header. If that’s out of your control, you can configure Craft to ignore it with the ipHeaders config setting:

/* config/general.php */

'ipHeaders' => [
    'Client-IP',
    'X-Forwarded',
    'X-Cluster-Client-IP',
    'Forwarded-For',
    'Forwarded',
],

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

No branches or pull requests

3 participants