Nginx+PHP-FPM部署Azure容器应用时响应截断问题排查求助
Nginx响应截断问题排查求助
本地运行Nginx容器一切正常,但部署到Azure容器应用后出现响应被截断的问题——返回的页面内容会中途突然终止。目前认为主要环境差异是Azure创建的负载均衡器,但不清楚具体排查方向。
PHP访问日志
10.0.0.47 - - [29/Jan/2025:01:07:57 +0000] "GET /s/contacts HTTP/1.1" 200 65365 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/s/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:01:08:06 +0000] "GET /s/dashboard HTTP/1.1" 200 65381 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:01:20:07 +0000] "GET /s/keep-alive?_=1738112884973&mauticUserLastActive=721 HTTP/1.1" 200 5 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/s/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:01:32:07 +0000] "GET /s/keep-alive?_=1738112884974&mauticUserLastActive=1441 HTTP/1.1" 200 5 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/s/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:01:39:09 +0000] "GET /s/dashboard HTTP/1.1" 200 138978 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:01:42:16 +0000] "GET / HTTP/1.1" 302 306 "https://sandbox-4.reactblade.portal.azure.net/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:01:42:16 +0000] "GET /s/dashboard HTTP/1.1" 200 65397 "https://sandbox-4.reactblade.portal.azure.net/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:02:01:00 +0000] "GET / HTTP/1.1" 302 306 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:02:01:01 +0000] "GET /s/dashboard HTTP/1.1" 200 65389 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0"
静态资源访问日志
10.0.0.11 - - [28/Jan/2025:19:24:09 +0000] "GET /media/libraries/ckeditor/ckeditor.js?v58771f16 HTTP/1.1" 200 1587514 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/s/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.11 - - [28/Jan/2025:19:24:10 +0000] "GET /app/bundles/CoreBundle/Assets/css/libraries/remixicon/fonts/remixicon.woff2?t=1718271040674 HTTP/1.1" 200 165440 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/media/css/libraries.css?v58771f16" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.11 - - [28/Jan/2025:19:24:10 +0000] "GET /app/assets/images/favicon.ico?v58771f16 HTTP/1.1" 200 12862 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/s/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0" 10.0.0.47 - - [29/Jan/2025:02:01:07 +0000] "GET /favicon.ico HTTP/1.1" 200 12862 "https://mautic-nginx.thankfulmoss-a713c7bc.eastus2.azurecontainerapps.io/healthz" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0"
错误日志
2025/01/29 02:52:17 [info] 14#14: *1282 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:22 [info] 14#14: *1283 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:27 [info] 11#11: *1284 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:27 [info] 11#11: *1285 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:32 [info] 14#14: *1286 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:37 [info] 11#11: *1288 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:37 [info] 14#14: *1287 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:42 [info] 14#14: *1289 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:47 [info] 11#11: *1291 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:47 [info] 14#14: *1290 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:52 [info] 14#14: *1292 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:57 [info] 11#11: *1294 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:52:57 [info] 11#11: *1293 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:53:02 [info] 14#14: *1295 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:53:07 [info] 14#14: *1296 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:53:07 [info] 14#14: *1297 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80 2025/01/29 02:53:12 [info] 11#11: *1298 client closed connection while waiting for request, client: 10.0.0.33, server: 0.0.0.0:80
已确认错误日志中的client closed connection来自负载均衡器的健康检查,但手动访问健康检查端点返回200"healthy",对此感到困惑。想咨询后续排查方向:问题可能出在哪些配置文件,或是负载均衡器本身?
内容的提问来源于stack exchange,提问作者Adam Wheeler
相关产品推荐
相关产品推荐

