These strings are sorted internally from longest to shortest,
allowing the most specific string to be matched first.
It's not correct. Please, correct my spell:
nginx finds the longest match to conventional string.
These strings are sorted internally in lexical order,
so the search is terminstaed just when URI became
lexically more than a string.
I don't understand what you mean by "lexical order" - can you explain
it in simpler terms or provide an example?