参考知乎:

Linux服务器防火墙配置教程(端口关闭和放行) - 知乎

背景:客户服务器宕机重启后出现的问题

1.ps aux |grep xxx.jar  查看进程是否在,如果不在请重启。tomcat和springboot两种命令

2.查看网关nginx是否正常:systemctl status nginx   

附上2条nginx的优雅启动命令:

优雅的加载nginx配置文件:sudo systemctl reload nginx

优雅地重启Nginx:sudo systemctl restart nginx

3.如果这些都正常,可以用下postman中生成的curl命令测试

curl --location --request POST 'http://xxx:xxx:xxx:xxx/morningRun/statisticsData' \
--header 'Content-Type: application/json' \
--data '{
"className": "504",
"endTime": "2021-09-25 07:00:00",
"startTime": "2021-09-25 06:00:00"
}'

如果没有数据返回,那么问题有可能就是防火墙没有关



查看防火墙状态
systemctl status firewalld.service

关闭防火墙
systemctl stop firewalld.service

开启防火墙
systemctl start firewalld.service

关闭防火墙开机启动
systemctl disable firewalld
开机启动
systemctl is-enabled firewalld


查看防火墙已开放端口列表
firewall-cmd --list-all

重新访问,问题解决。 

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:1 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐