shanghai1943
V2EX  ›  问与答

NGINX 日志没有打印 request body

  •  
  •   shanghai1943 · May 31, 2022 · 1136 views
    This topic created in 1454 days ago, the information mentioned may be changed or developed.
    一个 PATCH 请求,从 slb 日志上可以看到 request length 为 11213 ,但是 NGINX 日志里本应显示请求体的那一栏显示了 - ,NGINX 配置里已配置了 "$request_body"。

    想问下是什么原因呢?莫非是因为 request length 太长所以不打印了?
    shanghai1943
        1
    shanghai1943  
    OP
       May 31, 2022
    自己测了一下,request length 在 10541 的时候还会打印 body 的,后面加到 18275 之后就不打印了。估计是跟请求大小有关
    shanghai1943
        2
    shanghai1943  
    OP
       May 31, 2022
    试了一下,调整 client_body_buffer_size 的大小可以让 body 打印出来。

    参考 http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5299 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 01:17 · PVG 09:17 · LAX 18:17 · JFK 21:17
    ♥ Do have faith in what you're doing.