Varnish rewrites location header

515 Views Asked by At

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

2

There are 2 best solutions below

0
On BEST ANSWER

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.

1
On

Varnish does not support ssl. There is official explanation why: https://www.varnish-cache.org/docs/trunk/phk/ssl.html