Hello, before I installed Varnish, I was redirecting the www version of my domain to the non-www version with the following code:
server {
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
and in my main server block I had:
server_name example.com;
However, now that I have installed Varnish, I get a too many re-directs error or something. I've had to disable these bits of code and change the second bit of code to:
server_name localhost; and use it like this.
How do I make www redirect to non-www now?
Thanks.
server {
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
and in my main server block I had:
server_name example.com;
However, now that I have installed Varnish, I get a too many re-directs error or something. I've had to disable these bits of code and change the second bit of code to:
server_name localhost; and use it like this.
How do I make www redirect to non-www now?
Thanks.