#Nginx
共 47 篇文章
Nginx 的 fail_timeout 不控制单次请求超时
Nginx 的 fail_timeout 和 max_fails 用于后端失败判定,不能相除得到单请求超时。按连接、发送和读取阶段配置时限,并区分重试与后端选择。
Nginx 报 SSL 共享缓存大小 conflicts with already declared size
定位同名 ssl_session_cache 共享区的冲突声明,统一大小或按需要拆分名称,保留 HTTPS 配置并验证重载。
Nginx 在 if 中设置 proxy_set_header 报 directive is not allowed here
Nginx 的 proxy_set_header 不允许放在 if 中。用 HTTP 级 map 计算条件值,在 location 设置请求头,并检查默认 Accept、URI 匹配和代理头继承。
Nginx 反代路径下的 JS、CSS 被静态文件正则截走
反代前缀下只有 JS、CSS 请求落到 Nginx 本地目录时,核对同级扩展名正则是否覆盖普通前缀选择。用限定范围的 ^~ 保留资源代理,并验证原有权限与 URI 映射。
Nginx 配置报 events directive is not allowed here
Nginx 在 conf.d 文件中报 events 或 worker_connections directive is not allowed here,通常与 include 所在的配置层级有关。核对实际主配置,将事件设置合并回已有 events 块,再检查并加载。
Nginx 已配 TLS,wss 仍失败:前端连到了明文后端端口
wss 地址必须连接实际提供 TLS 的入口。区分浏览器到 Nginx 与代理到应用两段连接,再核对端口、路径、Upgrade 和应用握手结果。


