Opened 4 years ago

Closed 4 years ago

#1963 closed defect (invalid)

Documentation does not mention important info about named locations at try_files

Reported by: KES777@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.17.x
Keywords: Cc:
uname -a:
nginx -V: no version

Description

The full post is [here](In short there is no info about how to use many named locations at try_files directive)

In short there is no info about how to use many named locations at try_files directive

Change History (1)

comment:1 by Maxim Dounin, 4 years ago

Resolution: invalid
Status: newclosed

The documentation clearly says:

The last parameter can also point to a named location, as shown in examples below.

Note that no other parameters are allowed to be named locations, as these parameters specify files to test, not locations. That is, the full information about using multiple named locations in the try_files directive is as follows: you can't, you can only use one named location as a fallback URI.

If you need to use multiple named locations in the try_files directive for some reason, you probably want to use something different instead. Like either using multiple locations with multiple try_files directives (if you want to test files, but cannot do so with just one try_files directive, for example, due complex directory structure and different root directories), or using the error_page-based fallback instead if you want to test multiple upstream servers.

Note: See TracTickets for help on using tickets.