Process Flow - Why location matching controls request routing
Incoming HTTP Request
Check location blocks in order
Match request URI with location pattern?
Select matched location
Route request to matched location handler
Response
Nginx checks each location block to find the best match for the request URI, then routes the request accordingly.