Rewriting all subdomains to one in particular.

Saimon Moore saimonmoore at
Fri Jan 19 19:34:38 MSK 2007


I have a nginx config with 4 virtual hosts.

Specifically I have the following server_name declarations in my virtual




#VH4 *;

What I'd like to do is rewrite any request for VH4 (i.e. not
es/en/ to :

So if a request comes in for I'd like to rewrite it to$request_filename

I've tried a few things but haven't managed to get it right.

My latest try:

#In VH4 server declaration
location /
  if ($host !~ "/^(www\.)?amicsmuseuprecolombi\.org/") {
    rewrite  (.*)$1  permanent;


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list