14 messages in ru.sysoev.nginxRe: Is it possible to have a loop in ...
FromSent OnAttachments
mobi...@public.gmane.orgJan 30, 2008 3:55 pm 
Cliff WellsJan 30, 2008 4:03 pm 
Casey RaymanJan 30, 2008 4:06 pm 
mobi...@public.gmane.orgJan 30, 2008 4:07 pm 
mobi...@public.gmane.orgJan 30, 2008 4:10 pm 
Eden LiJan 30, 2008 4:52 pm 
mobi...@public.gmane.orgJan 30, 2008 5:56 pm 
mobi...@public.gmane.orgJan 30, 2008 6:19 pm 
Casey RaymanJan 30, 2008 7:43 pm 
Igor SysoevJan 30, 2008 10:04 pm 
Grzegorz NosekJan 31, 2008 12:08 am 
ThomasJan 31, 2008 1:46 am 
Mike LottJan 31, 2008 3:47 am 
ThomasJan 31, 2008 4:31 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Is it possible to have a loop in config?Actions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Jan 30, 2008 10:04:39 pm
List:ru.sysoev.nginx

On Wed, Jan 30, 2008 at 06:06:40PM -0600, Casey Rayman wrote:

I'm using nginx as a reverse proxy and so I've got several sites which use exactly the same config with the exception of the port. Is there a way to do something like....

array {10,20,99}

for each i in array { server { listen $i; ... } }

Perhaps an odd question, but nginx has all kinds of useful features I'd never thought of before.

No, nginx has no macro support.

However, if your servers different in port number only, then you can use

server { listen 10; listen 20; listen 99; ... }