当前位置:网站首页>一次线上移动端报表网络连接失败问题定位与解决
一次线上移动端报表网络连接失败问题定位与解决
2022-06-27 09:25:00 【lgq2016】
公司某个用户出差到国外A国分公司B,手机连接分公司B内网可以正常查看报表,连接其他网络都显示:“网络连接失败”。
经排查,A国分公司B内网走的移动端代理是国内代理服务器,其他网络走的是A国代理服务器,A国代理服务器执行:curl 报表地址 显示 403 forbidden,国内代理服务器执行:curl 报表地址 显示200,所以定位到问题。
网络架构为:dns->f5->移动代理服务器->集中代理服务器(nginx)->应用代理服务器(nginx)->应用服务器
在本地浏览器访问 报表地址返回403 forbidden【nginx x.x.x】,可以判断是用于代理服务器ng这里出了问题。ng 403 forbidden常见的原因有四种,参考网上其他总结,如下所示:
一、由于启动用户和nginx工作用户不一致所致
1.1查看nginx的启动用户,发现是nobody,而为是用root启动的
命令:ps aux | grep "nginx: worker process" | awk'{print $1}'
1.2将nginx.config的user改为和启动用户一致,
命令:vi conf/nginx.conf
二、缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件。
1. server {
2. listen 80;
3. server_name localhost;
4. index index.php index.html;
5. root /data/www/;
6. }
如果在/data/www/下面没有index.php,index.html的时候,直接文件,会报403 forbidden。
三、权限问题,如果nginx没有web目录的操作权限,也会出现403错误。
解决办法:修改web目录的读写权限,或者是把nginx的启动用户改成目录的所属用户,重启Nginx即可解决
1. chmod -R 777 /data
2. chmod -R 777 /data/www/
四、SELinux设置为开启状态(enabled)的原因。
4.1、查看当前selinux的状态。
1. /usr/sbin/sestatus
4.2、将SELINUX=enforcing 修改为 SELINUX=disabled 状态。
1. vi /etc/selinux/config
2.
3. #SELINUX=enforcing
4. SELINUX=disabled
4.3、重启生效。reboot。
1. reboot
重启php以及nginx
killall php-fpm && php-fpm &
nginx -s reload
我这里是第二种,两个应用服务器的前端打包文件,目录竟然不一样,其中一个少了目录static和index.html文件,这个是项目之前的负责人挖的小坑。。。
参考:
https://blog.csdn.net/darkdragonking/article/details/123199655
https://blog.csdn.net/huangchonghai/article/details/121993331
边栏推荐
- 【系统设计】邻近服务
- How Oracle converts strings to multiple lines
- 更改pip镜像源
- 2022.06.26 (LC Luo 6101 Luo determines whether the matrix is an X matrix)
- i=i++;
- RMAN-08137 主库无法删除归档文件
- Apache POI的读写
- Rockermq message sending mode
- Flow chart of Alipay wechat payment business
- Getting started with webrtc: 12 Rtendpoint and webrtcendpoint under kurento
猜你喜欢
Installation and usage of source insight tool
Source insight 工具安装及使用方法
ucore lab3
DV scroll board width of datav rotation table component
prometheus告警流程及相关时间参数说明
[cloud native] 2.3 kubernetes core practice (Part 1)
不容置疑,这是一个绝对精心制作的项目
ucore lab5
Matlab tips (19) matrix analysis -- principal component analysis
E+h secondary meter repair pH transmitter secondary display repair cpm253-mr0005
随机推荐
静态代码块Vs构造代码块
Flow chart of Alipay wechat payment business
Getting started with webrtc: 12 Rtendpoint and webrtcendpoint under kurento
2022.06.26 (LC Luo 6101 Luo determines whether the matrix is an X matrix)
Reading and writing Apache poi
不容置疑,这是一个绝对精心制作的项目
浏览器的markdown插件显示不了图片
[system design] proximity service
支付宝微信支付业务流程图
【生动理解】深度学习中常用的各项评价指标含义TP、FP、TN、FN、IoU、Accuracy
MYSQL精通-01 增删改
冒牌构造函数???
Five page Jump methods for wechat applet learning
win10为任意文件添加右键菜单
数字IC-1.9 吃透通信协议中状态机的代码编写套路
ucore lab3
Understand neural network structure and optimization methods
fastadmin 安装后访问后台提示模块不存在
微信小程序学习之五种页面跳转方法.
Conception de plusieurs classes