我想测试nginx的回声模块。我想回显我在浏览器中输入的网址。为什么请求没有后缀的文件扩展名的HTML将下载文件?
我的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/.
回报:返回文件和文件具有内容:/hello/
输入网址:http://127.0.0.1/hello/hi
回报:返回文件和文件具有内容:/hello/hi
输入网址:http://127.0.0.1/hello/hi.html
回报:打印/hello/hi.html
在浏览器。
我的问题: 为什么没有HTML后缀的网址将成为下载文件? 如何解决它? 我只是想在浏览器打印网址。