Score:0

What the "uri" written in nginx doc(difference with the "file")?

cn flag

The last argument of try_files directive is slightly different from the others, it has a leading slash(but not means absolute path): e.g. try_files $uri $uri.html $uri/ /fallback/index.html;.

And the doc distinguish them as file and uri.

Also the doc of error_page, the last argument written as uri and it may internally redirect, like try_files one's.

Sum up above, uri means follows right?:

  • start with leading slash(/)
  • but not serve from absolute path, follow the directory within context
  • can cause an internal redirection(= lookup other location directives)
Score:0
ng flag

This last URI argument is compared against your location blocks - and the best/longest match is used to resolve it. So if you do not have location /fallback { in your nginx.conf - the above example will return error 404.

홍한석 avatar
cn flag
I understood the behavior when try_files or error_page fallbacks to *`uri`*. But I wonder that is there any definition or reference for *`uri`*, the doc indicates, to verify my last 3 statements in the question.
홍한석 avatar
cn flag
I gonna move to the server fault and close this question
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.