开发者社区> 问答> 正文

nginx报错:No input file specified.

文件夹内.user.ini文件问题


thinkphp3.1.1  nginx1.8.0 a.site.com可以访问(配置文件如下)
server
    {
        listen 80;
        #listen [::]:80;
        server_name a.site.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/a.site.com;

        include other.conf;
        #error_page   404   /404.html;
        location ~ [^/]\.php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            #include pathinfo.conf;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }


        if (!-e $request_filename)
        {
            rewrite ^/index.php(.*)$ /index.php?s=$1 last;
            rewrite ^(.*)$ /index.php?s=$1 last;
            break;
         }

        access_log  /home/wwwlogs/a.site.com.log  access;
    }


b.site.com  PHP文件不能访问报错提示:No input file specified.     静态文件访问没问题

server
    {
        listen 80;
        #listen [::]:80;
        server_name b.site.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/b.site.com;

        include other.conf;
        #error_page   404   /404.html;
        location ~ [^/]\.php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            #include pathinfo.conf;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }


        if (!-e $request_filename)
        {
            rewrite ^/index.php(.*)$ /index.php?s=$1 last;
            rewrite ^(.*)$ /index.php?s=$1 last;
            break;
         }

        access_log  /home/wwwlogs/b.site.com.log  access;
    }


展开
收起
靓哥 2017-12-26 14:58:56 2907 0
1 条回答
写回答
取消 提交回答
  • 旺旺:nectar2。
    版主回复:

    很高兴听到您自己已经解决了问题,同时更新了帖子的状态。
    2017-12-26 16:27:24
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载