hello maybe someone can help with simple rewrites
    Arvydas 
    arvydas at artogama.lt
       
    Thu Jun 16 15:01:28 MSD 2011
    
    
  
Hello,
I have difficulty converting these rewrite rules of apache into nginx. Could someone please provide a helping hand. 
RewriteRule     ^(.*)$                                  %{SERVER_NAME}$1                                [C]
RewriteCond     %{SERVER_NAME}                          ^(.*)\.example\.com$
RewriteRule     ^([a-z0-9-]+)\.example\.com/(.*)$         /home/www/$1/$2                       [L]
so if i go to test.example.com it should redirect me to /home/www/test/index.php|html
etc.
but in nginx somehow I get 2011/06/16 05:31:15 [error] 28649#0: *1 open() "/home/www///
it somehow does not recognize variables.
      server_name  ~^(.*)$;
       if ( $host ~ ^(.*)\.example\.com$ ) {
      rewrite ^([a-z0-9-]+)\.example\.com/(.*)$              /home/www/$1/$2 last;
}
root /home/www/$1/$2
Sincerely,
Arvydas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110616/2c30df1e/attachment.html>
    
    
More information about the nginx
mailing list