【发布时间】:2016-04-12 02:35:46
【问题描述】:
我想要实现的是,如果有人访问我的主页/索引页面,我需要提供我的 index.html 文件。但是,如果它是另一个 URL/路径,则将请求传递给我的 index.php 文件(我正在使用 Symfony)。
我关注this example,但没有工作。它总是为我的 PHP 文件提供服务。
server
{
listen 80;
server_name mysite.com;
root /path/to/my/web;
index index.html index.php;
location = /index.html
{
try_files $uri /index.html?$args;
}
location /
{
try_files $uri /index.php?$args;
}
}
如果您能与我分享任何帮助或指导,我将不胜感激。
【问题讨论】:
标签: nginx nginx-location