我想測試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後綴的網址將成爲下載文件? 如何解決它? 我只是想在瀏覽器打印網址。