登录报错502
报错:
502就是找不到应用,后台日志确实也没报错,通过查看前端nginx日志排查:
nginx没指定日志路径的话,一般默认路径/var/log/nginx
combetl@server42 logs]$ ll
总用量 31300
-rwxrwxrwx. 1 root root 31501423 12月 2 18:10 access.log
-rwxrwxrwx. 1 root root 533608 12月 2 18:10 error.log
-rw-r--r--. 1 combetl combetl 5 12月 2 18:02 nginx.pid
[scheduler@server42 logs]$ pwd
/usr/local/nginx1.18/logs
[scheduler@server42 logs]$ less error.log
2021/12/02 17:48:34 [error] 2575#0: *23 connect() failed (113: No route to host) while connecting to upstream, client: 10.10.88.9, server: localhost, request: "POST /combscheduler/login HTTP/1.1", upstream: "http://200.200.200.41:12345/combscheduler/login", host: "200.200.200.42:10000", referrer: "http://200.200.200.42:10000/combscheduler/ui/view/login/index.html"
2021/12/02 17:49:35 [notice] 3312#0: signal process started
看到 No route to host恍然大悟,一般都是防火墙原因,关闭防火墙,成功登录
关闭防火墙命令:
sudo systemctl stop firewalld
一开始有打开端口,只是没生效,用的是iptables:
sudo iptables -A INPUT -p tcp --dport 10000 -j ACCEPT