May 2025posted on 05.01.2025Nginx Nested Locations Nginx supports nested locations: server { location /app { location /app/assets { # ... } location /app/pages { # ... } } } Note that nested locations are not relative to the parent location. In the above example: location /app parent location block that matches requests starting with /app. location/app/assets nested location that matches /app/assets. location/app/pages nested location that matches /app/pages. No reactions yet
Nginx Nested Locations
Nginx supports nested locations:
Note that nested locations are not relative to the parent location.
In the above example:
location /appparent location block that matches requests starting with/app.location/app/assetsnested location that matches/app/assets.location/app/pagesnested location that matches/app/pages.