redirect subdomain to internal location

António P. P. Almeida appa at perusio.net
Wed May 25 23:01:30 MSD 2011


On 25 Mai 2011 19h14 WEST, nginx-forum at nginx.us wrote:


>> location ~ /(?<clientkey>[^/]*)/ {
>
> Appa,
>
> Thanks again!
>
> My issue is that I don't know the value of clientkey, it could be
> several hundred possibilities.
>
> Is there a way to extract the unknown clientkey from
> /clientkey/some/more.htm?
>
> Many thanks,

That's completely generic. It's a named group that captures any char
excepting '/'.

This implicitly creates a variable $clientkey that you can use.

Try it.
--- appa




More information about the nginx mailing list