NGINX API Versioning Techniques NGINX API Versioning Techniques nginx nginx

NGINX API Versioning Techniques


Make sure this is not about matching order:

nginx first searches for the most specific location given by literal strings regardless of the listed order. In the configuration above the only literal location is “/” and since it matches any request it will be used as a last resort.
Then nginx checks locations given by regular expression in the order listed in the configuration file. The first matching expression stops the search and nginx will use this location.
If no regular expression matches a request, then nginx uses the most specific literal location found earlier.

You can try a location directive, testing for the literal you want, and preventing any regex to be checked:

location ^~ /1.0/ {  # matches any query beginning with /1.0/ and halts searching,  # so regular expressions will not be checked.  [ configuration C ] }

Then you can check rewrite procedures.