Home >Backend Development >PHP Tutorial >nginx try_files usage

nginx try_files usage

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-08 09:25:381828browse

Example: Yii2 recommends Hungnix try_files configuration

location / {
    try_files $uri $uri/ /index.php?$agrs;
}

Find the file under the specified path. If it does not exist, transfer it to which file is executed.

try_files
语法: try_files file1 [file2 ... filen] fallback
默认值: 无
作用域: location

The above introduces the usage of nginx try_files, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn