网站可以正常访问但在后台管理中无法上传文件和图片,注册用户提交数据时报错:502 Bad Gateway Nginx,而在后台上传图片时Nginx错误日志则有如下报错:

upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: pan

.scun.net, request: "POST /index.php?controller=pic&action=upload_json&dir=image HTTP/1.1", upstream: "http://127.0.0.1:80/index.php?controller=pic&action=upload_json&dir=image", host: "pan.scun.net", referrer: "http://pan.scun.net/index.php?controller=seller&action=goods_edit&id=506"

解决:

1) 在DNS解析记录中增加CNAME解析,可以解决问题。

2)nginx 防火墙错误拦截,关闭nginx防火墙。