Maxim Dounin
August 02, 2012 06:44AM
Hello!

On Thu, Aug 02, 2012 at 10:38:15AM +0200, Christoph Schug wrote:

> Hello!
>
> I have another interesting scenario ;-) Given is following minimized
> test case

>
> server {
> listen 80;
> server_name t2.example.com;
>
> root /data/web/t2.example.com/htdoc;
>
> location ~ ^/bar(/.*)? {
> alias /data/web/t2.example.com/htdoc/foo$1;

This is expected to break once between location matching and
accessing a file (which will evaluate variables in the "alias"
directive) any regexp matching will happen.

Not only nested regex location matching (which is kind of
explicit), but even lookup of a map variable (with regexps) will
be enough to break things.

And this is why it's not recommended to use enumerated captures
except for very simple configurations (or "rewrite" directive,
where use of enumerated captures immediatly follows regexp
matching). Use named captures instead and you'll be fine.

[...]

Maxim Dounin

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

Bad side effect of (even unmatched) nested regex locations in regex locations with anonymous captures with try_files/alias

csg August 02, 2012 04:40AM

Re: Bad side effect of (even unmatched) nested regex locations in regex locations with anonymous captures with try_files/alias

Maxim Dounin August 02, 2012 06:44AM

Re: Bad side effect of (even unmatched) nested regex locations in regex locations with anonymous captures with try_files/alias

csg August 02, 2012 12:00PM

Re: Bad side effect of (even unmatched) nested regex locations in regex locations with anonymous captures with try_files/alias

Maxim Dounin August 02, 2012 01:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 233
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 466 on July 09, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready