Redirect without changing base server name??

Ed W lists at
Wed May 14 19:36:43 MSD 2008

Hi, I have a site which hosts several domains and they are all 
redirected to a single vhost.  I then want to redirect "/" to some 
starting URL, but when I do so the hostname in the URL changes to the 
first server name in my config, rather than staying the same as the user 

eg, user goes to "" and it should redirect 
to "", but what actually 
happens is that it goes to


        server {
          rewrite ^/$ /src/login.php redirect;

Suggestions please on how to fix this?  (Use an IF perhaps?  Seems ugly?)

Ed W

More information about the nginx mailing list