Welcome! Log In Create A New Profile

Advanced

Re: Nginx Map Multiple Parameter Input

October 12, 2012 08:58AM
On Oct 12, 2012, at 16:26 , rahul286 wrote:

> I have a case where I need to use Nginx map in slightly different way.
>
> I use following to create a variable $blogpath
>
>
> `map $uri $blogname{
> ~^(?P<blogpath>/[_0-9a-zA-Z-]+/)files/(.*) $blogpath ;
> }`
>
> Next, I want to run another map using:
>
>
> `map $http_host$blogpath $blogid{
> #map lines
> }`
>
>
> Problem is - map doesn't support 2 input parameters. It throws error:
> "nginx: [emerg] invalid number of the map parameters ..."
>
> As map is outside server{] block, I cannot use set to create a temporary
> variable to combine value of "$http_host$blogpath"
>
> Goal is to get "domain-name.com/first-dir" from URL. If any other nginx
> variable can give me entire URL as seen in browser, it will also work.
>
> Please suggest a workaround!

What version do you use ?

Changes with nginx 0.9.0 29 Nov 2010

...

*) Feature: the "map" directive supports expressions as the first
parameter.


--
Igor Sysoev
http://nginx.com/support.html

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

Nginx Map Multiple Parameter Input

rahul286 October 12, 2012 08:26AM

Re: Nginx Map Multiple Parameter Input

Igor Sysoev October 12, 2012 08:58AM

Re: Nginx Map Multiple Parameter Input

rahul286 October 12, 2012 09:14AM

Re: Nginx Map Multiple Parameter Input

Igor Sysoev October 12, 2012 09:48AM

Re: Nginx Map Multiple Parameter Input

rahul286 October 12, 2012 10:21AM

Re: Nginx Map Multiple Parameter Input

Igor Sysoev October 12, 2012 10:26AM

Re: Nginx Map Multiple Parameter Input

rahul286 October 12, 2012 10:37AM

Re: Nginx Map Multiple Parameter Input

Igor Sysoev October 12, 2012 10:44AM

Re: Nginx Map Multiple Parameter Input

rahul286 October 12, 2012 10:51AM

Re: Nginx Map Multiple Parameter Input

Igor Sysoev October 12, 2012 10:56AM

Re: Nginx Map Multiple Parameter Input

rahul286 October 12, 2012 11:14AM

Re: Nginx Map Multiple Parameter Input

Igor Sysoev October 12, 2012 01:20PM

Re: Nginx Map Multiple Parameter Input

rahul286 October 13, 2012 12:17PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
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