Welcome! Log In Create A New Profile

Advanced

Redirecting www to non-www with Varnish installed?

Posted by moka 
Redirecting www to non-www with Varnish installed?
April 30, 2013 05:35AM
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.



Edited 1 time(s). Last edit at 04/30/2013 05:36AM by moka.
Re: Redirecting www to non-www with Varnish installed?
May 04, 2013 07:51AM
Seems my question has fallen on deaf ears. Never mind.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 212
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready