Redirecting from to

Jean-Philippe Moal skateinmars at
Mon Sep 22 12:09:50 MSD 2008

Thomas a écrit :
> UPDATE: sorry, I had forgotten to add to /etc/hosts, so now
> redirection works.
> But if I put server_name _; back then I get the loop.
> I tried using this trick:
>  with server_name_in_redirect  off;
>  but I still get the infinite loop.
> Do I need to explicitly create a server_name for each domain I am
> handling? I would like to be able to create an unattended config file
> that I won't "ever" touch again.
My guess is your server block with "" on the server name is defined
before the other one with the name "_".
The first server block found is the one used when no Host matches any server
name (unless there's a "default" param for a server).

More information about the nginx mailing list