apache to nginx rewrite rule.

Kirill A. Korinskiy catap at catap.ru
Fri Aug 27 01:52:06 MSD 2010


server {
  server_name example.com vhost1.example.com vhost2.example.com;
  proxy_pass http://localhost:8080;
}

On Fri, Aug 27, 2010 at 00:37, khine <nginx-forum at nginx.us> wrote:

> hello, what is the way to convert this apache vhost directive to nginx?
> [code]
>
>  ServerName example.com
>  ServerAlias vhost1.example.com
>  ServerAlias vhost2.example.com
>  RewriteEngine On
>  RewriteRule ^/(.*) http://localhost:8080/$1 [P]
>
> [/code]
>
> also is there a way to read a list of ServerAlias'es dynamically, for
> example from a python list, ['vhost1.example.com',
> 'vhost2.example.com'...]
>
> thanks
>
> norman
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,124052,124052#msg-124052
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



-- 
wbr, Kirill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100827/4738e4f2/attachment.html>


More information about the nginx mailing list