Opened 6 years ago

Closed 6 years ago

#660 closed defect (worksforme)

Documentation on `location` directive lacks info on prefix strings

Reported by: Alex Dieulot Owned by:
Priority: minor Milestone:
Component: other Version: 1.7.x
Keywords: Cc:
uname -a:
nginx -V: _


The following configuration code in nginx will match any request URI starting by /ftg:

location /ftg {

There’s no explicit indication of that behavior in nginx’s documentation on `location`. We have to guess it from the examples (B and C).

I think it should be made clear that this is available, that a slash without a sign before will match the suffix. As it is now, it’s confusing.

Change History (1)

comment:1 by Maxim Dounin, 6 years ago

Resolution: worksforme
Status: newclosed

The documentation explicitly says "A location can either be defined by a prefix string, or by a regular expression...", and then describes how an appropriate location is selected among matching prefix strings and regular expressions. So, from correctness point of view, it's all there, and there are examples to illustrate things. Moreover, there are also various articles, see How nginx processes a request for example.

On the other hand, as locationis one of the main directives in nginx, it's documentation is a bit complicated and there is always a room for improvement. If you have suggestions on how to improve things, feel free to provide patches, repository for the documentation is at

Note: See TracTickets for help on using tickets.