Nginx matches incoming request URIs against the location blocks defined in your configuration. * `location /app/` matches requests to `/app/`, `/app/foo`, `/app/bar/123`, etc. * `location /app` (no trailing slash) matches `/app*` (i.e., `/application`, `/appfile`, etc.), This means in Nginx, the presence or absence of a slash in a location block changes the matching logic.
server {
location /app/ {
# Handles /app/ and anything below, e.g., /app/foo
}
location /app {
# Handles only /app with nothing after OR routes like /application, /appzzz
}
}Example of a vulnerable configuration: An attacker requesting `/styles../secret.txt` resolves to `/path/styles/../secret.txt`
location /styles {
alias /path/css/;
}Source: Reverse Proxy Misconfigurations/README.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.