Nginx——报错汇总

前言

记录NGINX的错误

错误

nginx: [emerg] unknown directive "erver" in /usr/local/nginx/conf/vhost/dev.api.ecdpower.net.conf:2

[root@ecs-75fb-0531684 vhost]# /usr/local/nginx/sbin/nginx -t
nginx: [emerg] unknown directive "erver" in /usr/local/nginx/conf/vhost/dev.xxx.net.conf:2
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

报错很明显,这个配置文件的第2行,但是坑爹的是第一行的server错了,修改下就好了

[root@ecs-75fb-0531684 vhost]# /usr/local/nginx/sbin/nginx -t
nginx: [warn] conflicting server name "140.xx.11" on 0.0.0.0:40001, ignored
nginx: [warn] conflicting server name "140.xx.11" on 0.0.0.0:443, ignored
nginx: [warn] conflicting server name "140.xx.11" on 0.0.0.0:443, ignored
nginx: [warn] conflicting server name "140.xx.11" on 0.0.0.0:443, ignored
nginx: [warn] conflicting server name "140.xx.11" on 0.0.0.0:443, ignored
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

nginx:post请求变为get

1. 设置了所有http请求转为https请求造成的,去除后就好了
2. return 307 https://<需跳转地址>$request_uri;

nginx: [emerg] duplicate upstream "bakend" in /usr/local/nginx/conf/./vhost/xxxxxx.conf:1

多个配置都用了bakend这个名称造成的,将其他的修改下就阔以了

open() "/var/run/nginx.pid" failed (2: No such file or directory)

进入到/usr/local/nginx/logs/查看error.log可以看到具体的报错信息.

根据报错找到对应的vhost,查看配置后得知,配置中的写入日志的目录没有存在,将错误的日志路径改为正确的即可,当然别忘记reload或者restart

./configure: error: the HTTP gzip module requires the zlib library.

完整错误信息

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using –without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by usingwith-zlib=<path> option.

解决方法

yum install -y zlib-devel

The plain HTTP request was sent to HTTPS port

完整错误信息

The plain HTTP request was sent to HTTPS port. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!
``
解决方法

监听的443端口后面加上ssl并添加相应的证书
server {
listen 80;
listen 443 ssl;
}

posted @   。思索  阅读(1306)  评论(0编辑  收藏  举报
编辑推荐:
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
阅读排行:
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· 程序员常用高效实用工具推荐,办公效率提升利器!
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 【译】WinForms:分析一下(我用 Visual Basic 写的)
点击右上角即可分享
微信分享提示