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

What are the proxy header settings for nginx? #8271

Closed
dandv opened this issue Jul 3, 2015 · 3 comments
Closed

What are the proxy header settings for nginx? #8271

dandv opened this issue Jul 3, 2015 · 3 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@dandv
Copy link
Contributor

dandv commented Jul 3, 2015

I'm reverse proxying from an https site to a Piwik installation for a domain without an SSL cert:

location /piwi {
    rewrite ^/piwi(/?.*)$ $1 break;
    proxy_set_header Host piwik.idorecall.com;
    proxy_set_header X-Real-IP $remote_addr;  # TODO Piwik doesn't know about this cache header, so all requests appear as from this very server
    proxy_pass http://piwik.idorecall.com;
}

I've read How do I configure Piwik when the server is installed behind a proxy? but didn't manage to figure out what the exact settings should be for nginx. Now because of the proxying, Piwik tracks all visits as coming from the server that hosts the app.

@halfdan
Copy link
Member

halfdan commented Jul 3, 2015

@dandv You need to make Piwik aware of the X-Real-IP header. As shown in the FAQ add an entry under [General] with proxy_client_headers[] = X-REAL-IP

@tsteur
Copy link
Member

tsteur commented Jul 5, 2015

Is this issue resolved?

@halfdan
Copy link
Member

halfdan commented Jul 6, 2015

Closing as solved. @dandv reopen if there are open questions.

@halfdan halfdan closed this as completed Jul 6, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

4 participants