当前位置:网站首页>一次线上移动端报表网络连接失败问题定位与解决
一次线上移动端报表网络连接失败问题定位与解决
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
边栏推荐
- Getting started with webrtc: 12 Rtendpoint and webrtcendpoint under kurento
- Rman-08137 main library failed to delete archive file
- ucore lab4
- 更改pip镜像源
- 0号进程,1号进程,2号进程
- C # solve the relative path problem using SQLite
- 提高效率 Or 增加成本,开发人员应如何理解结对编程?
- Preliminary understanding of pytorch
- Summary of three basic interview questions
- IMX8QXP DMA资源和使用(未完结)
猜你喜欢

webrtc入门:12.Kurento下的RtpEndpoint和WebrtcEndpoint

(original) custom drawable

I'm almost addicted to it. I can't sleep! Let a bug fuck me twice!

This, constructor, static, and inter call must be understood!

如何获取GC(垃圾回收器)的STW(暂停)时间?

视频文件太大?使用FFmpeg来无损压缩它

最全H桥电机驱动模块L298N原理及应用

Oracle uses an SQL to find out which data is not in a table

Preliminary understanding of pytorch

Source insight 工具安装及使用方法
随机推荐
There is no doubt that this is an absolutely elaborate project
Imx8qxp DMA resources and usage (unfinished)
Advanced mathematics Chapter 7 differential equations
this,构造器,静态,之间调用,必须搞懂啊!
(original) custom drawable
IO管脚配置和pinctrl驱动
Enumeration? Constructor? Interview demo
webrtc入门:12.Kurento下的RtpEndpoint和WebrtcEndpoint
Rockermq message sending mode
win10为任意文件添加右键菜单
Collection framework generic LinkedList TreeSet
HiTek电源维修X光机高压发生器维修XR150-603-02
Object contains copy method?
Summary of three basic interview questions
CLassLoader
1098 insertion or heap sort (PAT class a)
SVN版本控制器的安装及使用方法
The largest rectangle in the bar graph of force buckle 84
How much memory does the data type occupy? LongVsObject
Tips for using Jupiter notebook