Home >Backend Development >PHP Tutorial >nginx location root 设立虚拟目录

nginx location root 设立虚拟目录

WBOY
WBOYOriginal
2016-06-13 12:22:59960browse

nginx location root 设置虚拟目录
server{
       .....
       location /t/  {
                 root  /data/www;
       }
}

http://localhost/t/a.jpg 想访问到 /data/www/t/a.jpg   但是404 Not found
------解决思路----------------------
用别名

/home/wwwroot/default/img/; 就是图片真是存在的目录

http://192.168.1.227/image/a.jpg,工作目录下是没有image这个文件夹的

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