logging variables -- $bytes_sent .. where is $bytes_read ?

jb justinbeech at gmail.com
Sat Apr 18 02:17:33 UTC 2015


thanks,

the part where you massage the content lengths I was missing -- or had no
clue would be needed.


On Sat, Apr 18, 2015 at 12:06 PM, Valentin V. Bartenev <vbart at nginx.com>
wrote:

> On Saturday 18 April 2015 11:23:54 jb wrote:
> > gotcha, I saw the discarded body thing in the debug log. ok thanks,
> > um, how do you proxy_pass to nginx itself ?
> >
> > can you give an example ?
> > just proxy_pass http://127.0.0.1/
> > and proxy_pass_request_body off
> >
> > what about my return 200 "$content_length bytes" line still keep that?
> >
> [..]
>
> events {}
>
> http {
>    log_format  lengths  $request_length;
>
>    server {
>        location / {
>            proxy_pass http://unix:nginx.sock:;
>            proxy_pass_request_body off;
>
>            proxy_set_header X-Response "$content_length bytes";
>            proxy_set_header Content-Length "";
>
>            access_log  logs/lengths.log  lengths;
>        }
>    }
>
>    server {
>        listen unix:nginx.sock;
>        return 200 $http_x_response;
>    }
> }
>
> % telnet 127.0.0.1 8000
> Trying 127.0.0.1...
> Connected to 127.0.0.1.
> Escape character is '^]'.
> POST / HTTP/1.0
> Content-Length: 1000
>
> bbbbbbbbbbbbbbbbbbbbbbbb
> bbbbbbbbbbbbbbbbbbbbbbbb
> bbbbbbbbbbbbbbbbbbbbbbbb
> bbbbbbbbbbbbbbbbbbbbbbbb
> ^]
> telnet> close
> Connection closed.
> % cat logs/lengths.log
> 145
>
> --
> wbr, Valentin V. Bartenev
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150418/22d55197/attachment-0001.html>


More information about the nginx mailing list