index.php空白页面nginx php5-fpm有多个站点

时间:2017-04-09 15:31:15

标签: php nginx

我处于这种奇怪的情况,我设置了我的nginx,一切正常,直到我将第二个主机的索引文件从index.html更改为index.php。当我进行此更改时,第二个主机显示空白页。

#
# HOST 1
#

server {
       listen 80;
       listen [::]:80;

       server_name domain1.com;

       root /var/www/Folder1/public;
       index index.php;

       location / {
               try_files $uri $uri/ =404;
       }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }

}

#
# HOST 2
#

server {
       listen 80;
       listen [::]:80;

       server_name domain2.com;

       root /var/www/Folder2/public;
       index index.php;

       location / {
               try_files $uri $uri/ =404;
       }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }

}

设置是相同的,但同时第一个是完美的,第二个是

提前致谢。

0 个答案:

没有答案