If I needed to add a location rule specific to the .png
files, I would normally use:
location ~* \.png$ {
# …
}
An answer to this question has a highly upvoted comment that says:
If this occurs often (like thousands), it will incur a performance penalty due to regex matching. (…) I personally want Nginx "location" to support multiple "=" conditions instead of relying on a regex rule.
Is there a way to target a specific file extension (or multiple extensions) while avoiding regular expressions? If no, can I optimise the above regex further? (E.g. by making it more specific to a folder, maybe?)