My configuration is: Internet -> Nginx as SSL-Offloader -> Varnish -> Nginx + PHP
When I send a redirect from PHP to https://foo.bar I see http://foo.bar. It looks like Varnish rewrites Location header in response. How can I fix it?
It's Ok in configuration without Varnish: Internet -> Nginx as SSL-Offloader -> Nginx + PHP
Solved :) The problem was in balancer (Pound) config. Internet -> Pound -> Nginx as SSL-Offloader -> Varnish -> Nginx + PHP
I set RewriteLocation to 0 and it solve the issue.