linux nginx 网站访问提示502 Bad Gateway怎么操作?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux nginx 网站访问提示502 Bad Gateway怎么操作?相关的知识,希望对你有一定的参考价值。

参考技术A 试下重新配置网络,也可以看下浏览器的安全设置,还可以直接使用yum/apt安装nginx,以下是官网的安装步骤:
RHEL/CentOS
Install the prerequisites:
sudo yum install yum-utils

To set up the yum repository, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

By default, the repository for stable nginx packages is used. If you would like to use mainline nginx packages, run the following command:
sudo yum-config-manager --enable nginx-mainline

To install nginx, run the following command:
sudo yum install nginx

When prompted to accept the GPG key, verify that the fingerprint matches 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62, and if so, accept it.

Debian

Install the prerequisites:
sudo apt install curl gnupg2 ca-certificates lsb-release

To set up the apt repository for stable nginx packages, run the following command:
echo "deb http://nginx.org/packages/debian `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

If you would like to use mainline nginx packages, run the following command instead:
echo "deb http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

Next, import an official nginx signing key so apt could verify the packages authenticity:
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -

Verify that you now have the proper key:
sudo apt-key fingerprint ABF5BD827BD9BF62

The output should contain the full fingerprint 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 as follows:
pub rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
uid [ unknown] nginx signing key <signing-key@nginx.com>

To install nginx, run the following commands:
sudo apt update
sudo apt install nginx

Ubuntu
Install the prerequisites:
sudo apt install curl gnupg2 ca-certificates lsb-release

To set up the apt repository for stable nginx packages, run the following command:
echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

If you would like to use mainline nginx packages, run the following command instead:
echo "deb http://nginx.org/packages/mainline/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list

Next, import an official nginx signing key so apt could verify the packages authenticity:
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -

Verify that you now have the proper key:
sudo apt-key fingerprint ABF5BD827BD9BF62

The output should contain the full fingerprint 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 as follows:
pub rsa2048 2011-08-19 [SC] [expires: 2024-06-14]
573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62
uid [ unknown] nginx signing key <signing-key@nginx.com>

To install nginx, run the following commands:
sudo apt update
sudo apt install nginx

手机uc浏览器一直出现(几乎任意一个网站)都出现 400 Bad Request nginx这个

手机uc浏览器一直出现(几乎任意一个网站)都出现 400 Bad Request

nginx这个
但是360浏览器没有出现这个 400 Bad Request

nginx也可以正常浏览,这是为什么,我路由器也恢复了出厂还是不行,怎么的。

您好,很高兴为您服务!
关于您反馈UC浏览器访问网站打不开,提示Bad Request的问题,经过排查是由于网站无法识别您的浏览器标识,因此提示出错,请您在浏览器上更改浏览器标识(UA)、更改云端加速状态,网站识别到UA后即可正常打开了。同时也会在后续版本针对UA进行专项优化,可以彻底改善问题,欢迎您密切留意。
如果仍有问题,请您继续向我们反馈,我们会第一时间为您跟进。
参考技术A 亲,你浏览的网站不合法追问

去死

追答

这个因为我也访问过啦 建议不要访问啦

追问

基本每个网站都是呀

uc导航都是

参考技术B uc软件的问题,你还试过别的浏览器吗追问

试过,谷歌也不行

追答

浏览器的毛病,以前的的一般的网站都能上更新了有的就不能了

追问

现在uc上的都不行连搜索和uc导航都不行

参考技术C UC浏览器错误吧追问

不是

追答

哦哦

参考技术D 您好,你可以清除缓存,如果不行你卸载重装试试看,还有,UC要从官网上下载,不要去那些来路不明的网站下载。还有什么问题可以追问哦,我都会为您解答追答

追问

已经试过重装了,还是不行

追答

去官网下载下来试试

如果还不行你看看用数据流量或其它网络看行不行

追问

用手机的移动网络还是一样

追答

还有,关于400

错误代码:400 400错误是由于不正确的请求造成的,说明正在搜索的网页可能已经删除、更名或暂时不可用。 一般来说多刷新几次网页,关闭网页后重新开启可以解决

那就奇怪了,能提供一下手机型号和浏览器版本吗

追问

中兴n5

追答

你有把所有的数据清除过吗?重装了是不是又恢复设置了?

第5个回答  2014-08-13 安卓同样遇到,不过苹果可以正常使用

以上是关于linux nginx 网站访问提示502 Bad Gateway怎么操作?的主要内容,如果未能解决你的问题,请参考以下文章

502 bad gateway nginx怎么解决

Nginx 502 Bad Gateway如何解决

服务器出现 nginx 502 Bad Gateway

502 Bad Gateway 怎么解决?

打开出现502 Bad gateway怎么解决

访问迅雷动漫变得好慢,有时还会出现“502 Bad Gateway” 怎么解决啊!!!!!!