Opened 9 years ago

Last modified 5 years ago

#97 accepted defect

try_files and alias problems — at Version 5

Reported by: Maxim Dounin Owned by: somebody
Priority: minor Milestone:
Component: nginx-core Version:
Keywords: try_files alias Cc:
uname -a: na
nginx -V: na

Description (last modified by Maxim Dounin)

# bug: request to "/test/x" will try "/tmp/x" (good) and
# "/tmp//test/y" (bad?)
location /test/ {
    alias /tmp/;
    try_files $uri /test/y =404;
}
# bug: request to "/test/x" will fallback to "fallback" instead of "/test/fallback"
location /test/ {
    alias /tmp/;
    try_files $uri /test/fallback?$args;
}
# bug: request to "/test/x" will try "/tmp/x/test/x" instead of "/tmp/x"
location ~ /test/(.*) {
    alias /tmp/$1;
    try_files $uri =403;
}

Or document special case for regexp locations with alias? See 3711bb1336c3.

# bug: request "/foo/test.gif" will try "/tmp//foo/test.gif"
location /foo/ {
    alias /tmp/;
    location ~ gif {
        try_files $uri =405;
    }
}

Change History (5)

comment:1 by Maxim Dounin, 9 years ago

Description: modified (diff)
Status: newaccepted

comment:2 by Maxim Dounin, 9 years ago

Description: modified (diff)

comment:3 by Maxim Dounin, 9 years ago

Description: modified (diff)

Added case from ticket #176.

comment:4 by Maxim Dounin, 8 years ago

See also ticket #217.

comment:5 by Maxim Dounin, 7 years ago

Description: modified (diff)
sensitive: 0
Note: See TracTickets for help on using tickets.