nginx php 200 空白,nginx access_log显示访问200但页面空白怎么办

2ddb5ada2431a03ebc44c1ab46c73091.png

nginx access_log显示访问200但页面空白怎么办?

问题:

域名:zengzhang.in,下面一个 wordpress 程序

nginx 配置如下:server {

listen 80;

server_name zengzheng.in;

error_log /var/log/nginx/binge-error.log;

access_log /var/log/nginx/binge-access.log;

root /var/www/zengzhang.in/;

index index.php index.html index.htm;

location / {

try_files $uri $uri/ =404;

}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/share/nginx/www;

}

location ~ \.php$ {

try_files $uri =404;

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

部分访问日志如下:115.231.100.106 - - [12/Jun/2015:08:21:01 -0400] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"

115.231.100.106 - - [12/Jun/2015:08:21:02 -0400] "GET /favicon.ico HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"

101.226.73.30 - - [12/Jun/2015:08:21:31 -0400] "GET / HTTP/1.1" 200 31 "-" "DNSPod-Monitor/2.0"

115.231.100.106 - - [12/Jun/2015:08:22:27 -0400] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"

115.231.100.106 - - [12/Jun/2015:08:22:28 -0400] "GET /favicon.ico HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"

解决办法:

刚刚遇到了同样的问题,已经解决。

我注意到你的配置文件里面有两个root,第二个location块中有一个$document_root$fastcgi_script_name;此处的$document_root的值可能不是你期望的/var/www/zengzhang.in/,换成这个值试试看。

就是把第二个location中的$document_root$fastcgi_script_name换成/var/www/zengzhang.in/$fastcgi_script_name

更多相关知识,请访问PHP中文网!

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值