Overview - Exact match (=)
What is it?
Exact match (=) is a way to tell nginx to match a URL path exactly as it is written. When you use the equal sign in a location block, nginx will only use that block if the request URL matches the specified path perfectly, without any extra characters. This helps control how nginx handles requests by making sure only exact URLs trigger certain rules.
Why it matters
Without exact match, nginx might use a more general rule that partially matches a URL, causing unexpected behavior or serving the wrong content. Exact match ensures precise control over which requests get handled by which configuration, improving security and performance. It helps avoid confusion when multiple location blocks could match similar URLs.
Where it fits
Before learning exact match, you should understand basic nginx configuration and how location blocks work. After mastering exact match, you can learn about prefix matches, regular expression matches, and how nginx chooses between them to handle requests.