Map FastCGI Ports Dynamically

Valentin V. Bartenev ne at vbart.ru
Wed Feb 22 10:18:53 UTC 2012


On Wednesday 22 February 2012 13:31:41 justin wrote:
> Valentin,
> 
> Yeah, but failing to put the pieces together. How would I use map to
> build a sort of dynamic table that stored username, port combos?

> server_name ~^(?<user>.+)\.mydomain\.com$;

> user          fastcgi-port
> --------       ---------------
> bob            9001
> john           9002
> kelly           9003

 map $user $fastcgi_port {
     default  '';
     bob      9001;
     john     9002;
     kelly    9003;
 }

Did you read documentation?
http://wiki.nginx.org/HttpMapModule

 wbr, Valentin V. Bartenev



More information about the nginx mailing list