当前位置:网站首页>一次线上移动端报表网络连接失败问题定位与解决
一次线上移动端报表网络连接失败问题定位与解决
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
边栏推荐
- The largest rectangle in the bar graph of force buckle 84
- Getting started with webrtc: 12 Rtendpoint and webrtcendpoint under kurento
- (original) custom drawable
- 手把手带你玩摄像头模组
- The markdown plug-in of the browser cannot display the picture
- About the problem that the El date picker Click to clear the parameter and make it null
- Preliminary understanding of pytorch
- Improving efficiency or increasing costs, how should developers understand pair programming?
- main()的参数argc与argv
- C # solve the relative path problem using SQLite
猜你喜欢

(original) custom drawable

1098 Insertion or Heap Sort(堆排序解释)(PAT甲级)

Installation and use of SVN version controller

RockerMQ消息发送与消费模式

orthofinder直系同源蛋白分析及结果处理

了解神经网络结构和优化方法
快捷键 bug,可复现(貌似 bug 才是需要的功能 [滑稽.gif])

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

Imx8qxp DMA resources and usage (unfinished)

2022.06.26 (LC Luo 6101 Luo determines whether the matrix is an X matrix)
随机推荐
有关二叉树的一些练习题
Rockermq message sending and consumption mode
Win10 add right-click menu for any file
When multiple network devices exist, how to configure their Internet access priority?
RockerMQ消息发送与消费模式
Some exercises about binary tree
多个类的设计
Obsidian 一周使用心得(配置、主题和插件)
The most direct manifestation of memory leak
Modify the contents of /etc/crontab file directly, and the scheduled task will not take effect
Reading and writing Apache poi
JS 客户端存储
RMAN-08137 主库无法删除归档文件
[MySQL basic] general syntax 1
ucore lab4
MySQL proficient-01 addition, deletion and modification
Analysis of key technologies for live broadcast pain points -- second opening, clarity and fluency of the first frame
Imx8qxp DMA resources and usage (unfinished)
VIM from dislike to dependence (19) -- substitution
Object contains copy method?