前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >在nginx配置文件中删除了index.php就报错

在nginx配置文件中删除了index.php就报错

作者头像
botkenni
发布2022-01-21 11:24:51
7010
发布2022-01-21 11:24:51
举报
文章被收录于专栏:IT码农IT码农
代码语言:javascript
复制
[root@izkbs00av8xzccz conf.d]# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
[root@izkbs00av8xzccz conf.d]# vim default.conf
###################### Default ################################
server
{
    listen 80 default_server;
    server_name www.mydomain.com mydomain.com;
    index index.html index.htm index.php; #此行我去掉了index.php 和前面的index就出现报错
    root  /data/wwwroot/default;
    error_log /var/log/nginx/default-error.log crit;
    location ~ .*\.php$
    {
        fastcgi_pass  unix:/dev/shm/php-fpm-default.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include fastcgi_params;
        try_files $uri = 404;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma|mp4|ico)$
    {
        expires      30d;
        access_log off;
    }
    location ~ .*\.(js|css)$
    {
        expires      7d;
        access_log off;
    }
    location ~* \.(ftpquota|htaccess|htpasswd|asp|aspx|jsp|asa|mdb)?$ {
        deny all;
    }
################################ SSL #########################################
#listen 443 ssl;
#ssl on;
#ssl_certificate /data/cert/xxx.crt;
#ssl_certificate_key /data/cert/xxx.key
#ssl_session_timeout 5m;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
#ssl_prefer_server_ciphers
## 301 重定向 http => https
#if ( != "https") {
#return 301 https://;
#}
############################### extra ########################################
     include /etc/nginx/conf.d/extra/*.conf;
}
[root@izkbs00av8xzccz conf.d]# systemctl restart nginx #正确
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018/01/05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档