PHP 网站修改默认访问文件的nginx配置
搭建好lnmp后,有时候并不需要直接访问index.php,配置其他的默认访问文件比如index.html这时候需要配置一下nginx才能访问到你想要设置的文件
直接上代码,如下是我的配置的一份简单的nginx到php-fpm的站点,该站点默认访问目录/ecmoban/www/index.html
server{
listen80;
location/{
root/ecmoban/www;
indexindex.htmlindex.phpindex.htm;
}
error_page404/404.html;
location=/404.html{
root/usr/share/nginx/html;
}
error_page500502503504/50x.html;
location=/50x.html{
root/usr/share/nginx/html;
}
location~\.php${
root/ecmoban/www;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.html;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
}
}
以上所述是小编给大家介绍的PHP网站修改默认访问文件的nginx配置,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下