lnmp1.4下Typecho出现502 Bad Gateway
我已经看过了 LNMP一键安装包的Nginx 502 Bad Gateway错误可能原因及解决方法 那个帖子,但好像没有对应的情况,修改了一些配置也没有解决。我是个新手,百度谷歌也没找到该怎么办,所以就到这来求助了。下面是具体情况:前段时间我的typecho网站一直能正常访问,但昨天发现打开网站就502 Bad Gateway了,并且部署在同一vps上的其他网站(如nextcloud)都能正常访问,只有typecho博客不行。我试过移出typecho所有文件,换上一个简单的index.html,能正常访问;删掉config.php重新上传typecho程序,重新安装,也是502 Bad Gateway。php探针显示vps内存使用率也正常。
关键是前段时间typecho博客一直能正常访问,现在就一直502了,我只发现了四天前vps在我不知情的情况下重启了一次,不知道是哪里出现了问题? 需要我提供哪个log日志吗? /usr/local/nginx/logs/errorr.log
2018/04/27 23:12:11 1168#0: signal process started
2018/04/28 00:12:51 1844#0: signal process started
2018/04/28 00:46:41 962#0: signal process started
2018/04/28 01:16:05 1601#0: signal process started
2018/04/28 09:52:50 1692#0: signal process started
2018/04/28 10:01:36 2270#0: signal process started
2018/04/28 10:13:28 2841#0: signal process started
2018/04/28 10:17:42 3421#0: signal process started
2018/04/28 10:19:39 3984#0: invalid number of arguments in "include" directive in /usr/local/nginx/conf/vhost/我的域名.conf:25
2018/04/28 10:29:42 4548#0: signal process started
2018/04/28 11:07:26 5127#0: signal process started
2018/04/29 12:08:41 5823#0: signal process started
然后“我的域名.conf文件” 25行是
include enable-php-pathinfo.conf; 贴完整配置看一下,另外enable-php-pathinfo.conf也贴一下 /usr/local/nginx/conf/vhost/我的域名.conf
server
{
listen 80;
#listen [::]:80;
server_name 我的域名 ;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/我的域名;
include typecho.conf
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass127.0.0.1:9000;
}
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php-pathinfo.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/我的域名.log;
} /usr/local/nginx/conf/enable-php-pathinfo.conf
location ~ [^/]\.php(/|$)
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
include pathinfo.conf;
} 不好意思,我尝试把 /usr/local/nginx/conf/vhost/我的域名.conf 里的
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass127.0.0.1:9000;
}
用#注释掉,重启lnmp,网站又能正常访问了。但是原来不用注释也能正常访问,不知道是为什么?
如果您不清楚也没关系,毕竟问题好像已经解决了,感谢军哥
[ 本帖最后由 Lussac 于 2018-4-29 20:23 编辑 ]
回复 7# 的帖子
lnmp是socket连接,你改成端口肯定502,置顶帖的排查帖子肯定也是没仔细看
页:
[1]