【发布时间】:2017-05-27 13:43:05
【问题描述】:
我想测试 nginx 的 echo 模块。我想回显我在 浏览器中输入的 url。
我的nginx配置:
index index.php index.html index.htm index.nginx-debian.html ;
location / {
try_files $uri $uri/ /index.php =404;
}
location /hello {
echo $request_uri;
}
输入网址:http://127.0.0.1/hello/.
return : 返回一个文件 并且文件有内容 : /hello/
输入网址:http://127.0.0.1/hello/hi
return : 返回一个文件 并且文件有内容 : /hello/hi
输入网址:http://127.0.0.1/hello/hi.html
返回:打印 /hello/hi.html 在浏览器中。
我的问题: 为什么不带html后缀的url会变成下载文件? 如何解决? 我只想在浏览器中打印网址。
【问题讨论】:
标签: html nginx configuration