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!
--
Rahul Bansal
EasyEngine - https://github.com/rtCamp/easyengine