Apache to nginx rewrite rule

hello, what is the way to convert this apache vhost directive to nginx?


  ServerName example.com
  ServerAlias vhost1.example.com
  ServerAlias vhost2.example.com
  RewriteEngine On
  RewriteRule ^/(.*) http://localhost:8080/$1 [P]

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:

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

great, thanks

Posted at Nginx Forum: