我希望我的nginx make显示所有url的干净.
通过一些研究,我已经将第一个案例付诸实践.它通过以下配置完成:
location / {
root html;
index index.html index.htm index.php;
try_files $uri.html $uri/ =404;
}
Run Code Online (Sandbox Code Playgroud)
它适用于indexhtml.html显示为indexhtml,但.php没有任何反应.如果我将$ uri.html更改为$ uri.php,它既不适用于.html,也不适用于.php.我试图在php位置添加类似的东西,但没有任何成功.
有什么建议吗?