近期要设置一个前端页面,意图访问www.abc.com,就会显示该前端页面,前端页面的入口文件为index.html:
我原先的设置是所有的访问都会默认走 rewrite ^(.*)$ /app.php last;这条规则,
现在为了达成目的,理论上在添加一个location = / 就可以了,但是实际上是不行的,实际上还要增加location = /index.html,请问老师这是为啥?谢谢
server {
listen 80;
server_name www.abc.com;
#location = /index.html {
# root /server/wwwroot/distribution/h5;
#}
location = / {
root /server/wwwroot/distribution/h5;
index index.html;
}
location / {
rewrite ^(.*)$ /app.php last;
}
location = /app.php {
root /server/wwwroot/distribution/public/;
fastcgi_pass unix:/tmp/distribution.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}