Condensing Location Directives

locojohn nginx-forum at nginx.us
Fri Jul 27 13:25:24 UTC 2012


It's possible to use regex, such as:

location ~ ^/(?<type>[^/]+)/ {
  proxy_pass http://127.0.0.1:8080/$type/;
}

BUT two static (non-regex) locations are faster.

Andrejs

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,228898,229038#msg-229038



More information about the nginx mailing list