最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP网站修改默认访问文件的nginx配置代码
时间:2022-06-24 16:36:55 编辑:袖梨 来源:一聚教程网
搭建好lnmp后,有时候并不需要直接访问index.php,配置其他的默认访问文件比如index.html这时候需要配置一下nginx才能访问到你想要设置的文件
直接上代码,如下是我的配置的一份简单的nginx到php-fpm的站点,该站点默认访问目录/ecmoban/www/index.html
代码如下 | 复制代码 |
server { listen 80; location / { root /ecmoban/www; index index.html index.php index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { root /ecmoban/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.html; fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name; includefastcgi_params; } } |
以上所述是小编给大家介绍的PHP 网站修改默认访问文件的nginx配置,希望对大家有所帮助。
相关文章
- 次神光之觉醒恶魔猎手怎么样 09-01
- 诛仙2青云技能如何 09-01
- 异环车库有什么功能 09-01
- 全明星觉醒莉姆露露怎么玩 09-01
- 星痕共鸣各职业武器有什么搭配 09-01
- 斗罗大陆猎魂世界辅助武魂有哪些选择 09-01