陆零云
2026-11-09 20:15:39
31
0
后台导出订单偶尔 504,不是每次都这样,一天五六次。nginx error.log 里是 upstream timed out (110: Connection timed out) while reading response header from upstream,request_time 60.003,upstream_response_time 那一栏是短横线。
短横线说明 nginx 连响应头都没等到。但 PHP 慢日志里同一个请求只花了 1...
陆零云
2026-11-09 20:13:16
28
0
Vue 3 开的 history 模式,首页进得去,点链接也正常,唯独在 /order/123 这种地址上按 F5,出来的是 nginx 的 404 页面,响应头里 server 写着 nginx/1.24.0。
直接访问时 nginx 会去 root 目录下找 order/123 这个文件和目录,两样都没有就 404,整个过程跟单页应用没关系。前端路由只负责浏览器里的跳转,刷新之后请求先落到 nginx。
打开站点配置,location / 里写的是 t...
陆零云
2026-11-09 20:12:58
33
0
同一个页面,Chrome 正常,Edge 和部分安卓机白屏。F12 里 Network 一条请求都没有,Console 只有一行 ERR_HTTP2_PROTOCOL_ERROR。在服务器上 curl 同一个地址返回 200,内容是完整的。
先看协商结果。curl -I --http2 输出的是 HTTP/1.1,服务端没给 h2。openssl s_client 加 -alpn h2 再看,ALPN protocol 那一行是空的,服务端连 ALPN 扩...
陆零云
2026-11-09 20:12:40
31
0
React 项目用 BrowserRouter,本地刷新没问题,部署到 Nginx 上点进 /orders/1024 再按 F5 就是 404,页面上是 Nginx 自己的错误页,不是 React 白屏,说明请求根本没进前端。
history 模式的路径是假的,浏览器会真去请求 /orders/1024,磁盘上没这个文件。加 try_files $uri $uri/ /index.html 就好。麻烦的是加上之后接口出问题:/api/orders 也被回退...
陆零云
2026-11-09 20:09:59
28
0
管理后台从独立域名挪到 /admin 子目录,本地 npm run dev 一切正常,打包丢上去白屏。控制台第一条是 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html",后面跟着一串 /assets/index-8f2a.js 的 404。
vite.config....
陆零云
2026-11-09 20:08:47
27
0
换域名那次留下了四层跳转。用户点 http://old.com/a.html,依次经过 http://www.old.com/a.html、https://www.old.com/a.html、https://new.com/a.html,最后落在 https://www.new.com/a.html。curl 测 time_total 0.68 秒,跳转本身占了 0.5 秒。
Google 能跟到第五跳,但每跳都会重新排一次抓取队列,我这边测下来四跳的页...
陆零云
2026-11-09 20:03:03
36
0
站点切到 https 两周,百度抓的还是 http,状态码 200,页面照常打开就是没跳。curl -I http://www.example.com 返回 200,证书和 443 都正常,问题在 80 端口的 server 块。
conf 里有两个监听 80 的 server。一个写了 server_name www.example.com,里面还挂着老的 root 和 index;另一个没写 server_name,只写 listen 80 defau...
陆零云
2026-11-09 16:48:18
38
0
浏览器直接甩了个 413
上周帮人看一个素材后台,PHP 8.2、Nginx 1.24、宝塔,要传八十多兆的视频。点上传,进度条刚动页面就白了,Network 里那条请求是 413,响应体是 Nginx 默认错误页,PHP 的 error_log 里一条记录都没有。请求根本没进 PHP,是 Nginx 收包时把连接掐了。
我先让运维把 php.ini 的 upload_max_filesize 和 post_max_size 都改到 100M,php-fp...
陆零云
2026-11-09 16:13:50
33
0
现象
服务器重启后所有 PHP 页面返回 502 Bad Gateway,Nginx error_log 里是 connect() to unix:/run/php/php8.3-fpm.sock failed (13: Permission denied) while connecting to upstream。php-fpm8.3 进程在运行,配置检查也能通过,静态文件访问正常。
原因
Nginx 通过 unix socket 转发,连接时受文件权限...
陆零云
2026-11-09 15:50:12
30
0
现象
为了把旧链接 /article/123 跳到新地址,在站点配置里加了 rewrite 规则,nginx -t 显示语法正确,reload 也执行成功,访问老地址依旧 404,error_log 里没有一条 rewrite 记录。
原因
规则可能写在了另一个 server 块里,实际请求命中的是 default_server;前面有更精确的 location 先匹配走了,rewrite 根本轮不到;rewrite 结尾没有写 last 或 break,...