heek
V2EX  ›  2018

access log 打 post 请求体

  •  
  •   heek · Mar 15, 2018 · 2285 views
    This topic created in 3014 days ago, the information mentioned may be changed or developed.

    为什么不允许 access log 里打印 post 请求体?各位大神给解释一下

    3 replies    2018-03-16 14:48:42 +08:00
    airyland
        1
    airyland  
       Mar 15, 2018
    无论你先试下谷歌或者百度都应该能找到怎么实现吧。

    关键词:access log post
    julyclyde
        2
    julyclyde  
       Mar 16, 2018
    这问法很知乎啊

    教你一句:
    先问是不是,再问为什么
    stach
        3
    stach  
       Mar 16, 2018
    access log 可以打印请求体的,需要定义 log_format,输出 $request_body。
    然后,nginx 会把 $request_body 里面的中文转义处理,看起来就像乱码,解析方法我写了一篇博文。

    http://hopehook.com/2017/12/18/nginx_request_body_parse/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3696 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 04:41 · PVG 12:41 · LAX 21:41 · JFK 00:41
    ♥ Do have faith in what you're doing.