Welcome! Log In Create A New Profile

Advanced

Re: Map FastCGI Ports Dynamically

Valentin V. Bartenev
February 23, 2012 04:56AM
On Thursday 23 February 2012 05:28:04 justin wrote:
> Valentin,
>
> Ok, well I am almost there. The problem is since we need to define the
> map block outside of server, the $user variable is not defined yet.
> I.E.
>
> http {
> # $user is not defined yet, it comes from inside server {}
> map $user $user_fastcgi_port {
> default 9000;
> justin 9001;
> simon 9002;
> }
> }
>
> server {
> # Set's $user
> server_name ~^(?<user>.+)\.my\.domain\.com$;
> }
>

Did you try, or it's just your guess? There's no "variable scope" concept in
nginx configuration. And it mostly has declarative nature, therefore, the order
of most directives is not important, unless it is specifically documented.

btw, your example config also wrong. If look at the documentation, you will see:

server
syntax: server { ... }
default: —
context: http

http://nginx.org/en/docs/http/ngx_http_core_module.html#server

wbr, Valentin V. Bartenev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Map FastCGI Ports Dynamically

Anonymous User February 21, 2012 09:58PM

Re: Map FastCGI Ports Dynamically

Valentin V. Bartenev February 22, 2012 03:08AM

Re: Map FastCGI Ports Dynamically

Anonymous User February 22, 2012 04:31AM

Re: Map FastCGI Ports Dynamically

Valentin V. Bartenev February 22, 2012 05:20AM

Re: Map FastCGI Ports Dynamically

Anonymous User February 22, 2012 12:56PM

Re: Map FastCGI Ports Dynamically

Volodymyr Kostyrko February 22, 2012 06:22AM

Re: Map FastCGI Ports Dynamically

Anonymous User February 22, 2012 04:16PM

Re: Map FastCGI Ports Dynamically

Valentin V. Bartenev February 22, 2012 05:08PM

Re: Map FastCGI Ports Dynamically

Anonymous User February 22, 2012 05:24PM

Re: Map FastCGI Ports Dynamically

Valentin V. Bartenev February 22, 2012 07:56PM

Re: Map FastCGI Ports Dynamically

Anonymous User February 22, 2012 08:28PM

Re: Map FastCGI Ports Dynamically

Valentin V. Bartenev February 23, 2012 04:56AM

Re: Map FastCGI Ports Dynamically

Anonymous User February 23, 2012 02:23PM

Re: Map FastCGI Ports Dynamically

Volodymyr Kostyrko February 23, 2012 10:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready