NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
fxxkgw
V2EX  ›  NGINX

nginx 配置里如何判断 body_bytes_sent 是否 0?

  •  
  •   fxxkgw · Nov 2, 2016 · 4423 views
    This topic created in 3561 days ago, the information mentioned may be changed or developed.

    nginx get 文件时,有些源文件大小为 0 ,返回码 200 ,$body_bytes_sent 的值为 0 ,如何在配置里 判断当$body_bytes_sent 为 0 时,不返回 200 而返回指定的码。

    1 replies    2016-11-03 00:39:29 +08:00
    ryd994
        1
    ryd994  
       Nov 3, 2016
    建议你好好看下 http 协议
    状态码是第一个发送的,状态码发送的时候 body 根本没开始
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   917 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:25 · PVG 05:25 · LAX 14:25 · JFK 17:25
    ♥ Do have faith in what you're doing.