nginx location blocks
Nginx has tons of options for handling uri requests inside a location block.
To match an exact route, use the =
sign.
To match a route prefix, just drop the =
This will match any request that starts with /users
, i.e. /users/summary
You can also do regex-style pattern matching, helpful for serving up static assets:
The ~*
matches regardless of case, i.e. STYLES.CSS
or styles.css
. To do exact matching (case sensitive), just drop the *
.