redirect subdomain to internal location

António P. P. Almeida appa at perusio.net
Thu May 26 15:04:09 MSD 2011


On 26 Mai 2011 11h47 WEST, nginx-forum at nginx.us wrote:

> Nearly there!
>
> Thanks to Appa I have got this far...
>
> location ~ /(?<clientkey>[^/]*)/ {
>
> What I didn't consider was that sometimes the result I am testing
> for may not have a proceeding '/'.

location ~ ^/(?<clientkey>[^/]*) {
  (...)
}

All requests of the form domain.com/whatever are now matched. You're
capturing only the 1st component of the URI 'whatever'.

--- appa

 




More information about the nginx mailing list