<div dir="ltr">Hey, <div><br></div><div>I solved my 'problem' with using post_action after proxy_pass. Thank you.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 3:00 PM,  <span dir="ltr"><<a href="mailto:nginx-devel-request@nginx.org" target="_blank">nginx-devel-request@nginx.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send nginx-devel mailing list submissions to<br>
        <a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:nginx-devel-request@nginx.org">nginx-devel-request@nginx.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:nginx-devel-owner@nginx.org">nginx-devel-owner@nginx.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of nginx-devel digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. handler before proxy-pass (Donatas Abraitis)<br>
   2. Re: handler before proxy-pass (Maxim Dounin)<br>
   3. Re: [PATCH] append "-gzip" to etags processed by<br>
      gzip_filter_module + not modified support (Andrew Williams)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 29 May 2014 15:05:15 +0300<br>
From: Donatas Abraitis <<a href="mailto:donatas.abraitis@gmail.com">donatas.abraitis@gmail.com</a>><br>
To: <a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
Subject: handler before proxy-pass<br>
Message-ID:<br>
        <CAPF+HwUu2r8eOALA46=<a href="mailto:LWmOS0XQTVYPDeurBkNpAn63--V_O7Q@mail.gmail.com">LWmOS0XQTVYPDeurBkNpAn63--V_O7Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello,<br>
<br>
I want to add a custom 'handler', which would update ngx_os_argv[0] on<br>
request. It should be like this:<br>
<br>
root     18601  0.0  0.0  62272  3812 ?        Ss   07:00   0:00 nginx:<br>
master process /opt/nginx/bin/nginx -c /opt/nginx/etc/nginx.conf<br>
web      18602  0.0  0.0  70372  7904 ?        S    07:00   0:00  \_<br>
183.54.68.10 [<a href="http://test.domain.com" target="_blank">test.domain.com</a>] GET /ok.php HTTP/1.1??Host<br>
<br>
It works if using only nginx for static content, but if having proxy_pass<br>
in location directive it doesn't work.<br>
<br>
Code snippet is like this:<br>
<br>
{<br>
...<br>
   sprintf(title, "%s [%s] %s", r->connection->addr_text.data,<br>
r->headers_in.server.data, r->request_line.data);<br>
   memcpy(ngx_os_argv[0], title, MAXBUF);<br>
   return NGX_DECLINED;<br>
}<br>
<br>
Question is, how to solve this problem to update ngx_os_argv[0] if using<br>
together with proxy_pass? Seems it bypass my 'handler' if using proxy_pass.<br>
Maybe there is some kind of sequence of loading modules?<br>
<br>
--<br>
Donatas<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.nginx.org/pipermail/nginx-devel/attachments/20140529/66347976/attachment-0001.html" target="_blank">http://mailman.nginx.org/pipermail/nginx-devel/attachments/20140529/66347976/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 29 May 2014 16:29:22 +0400<br>
From: Maxim Dounin <<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>><br>
To: <a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
Subject: Re: handler before proxy-pass<br>
Message-ID: <<a href="mailto:20140529122922.GK1849@mdounin.ru">20140529122922.GK1849@mdounin.ru</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
Hello!<br>
<br>
On Thu, May 29, 2014 at 03:05:15PM +0300, Donatas Abraitis wrote:<br>
<br>
> Hello,<br>
><br>
> I want to add a custom 'handler', which would update ngx_os_argv[0] on<br>
> request. It should be like this:<br>
><br>
> root     18601  0.0  0.0  62272  3812 ?        Ss   07:00   0:00 nginx:<br>
> master process /opt/nginx/bin/nginx -c /opt/nginx/etc/nginx.conf<br>
> web      18602  0.0  0.0  70372  7904 ?        S    07:00   0:00  \_<br>
> 183.54.68.10 [<a href="http://test.domain.com" target="_blank">test.domain.com</a>] GET /ok.php HTTP/1.1??Host<br>
><br>
> It works if using only nginx for static content, but if having proxy_pass<br>
> in location directive it doesn't work.<br>
<br>
This isn't going to work in any case, as there are multiple<br>
requests in a single worker process.<br>
<br>
> Code snippet is like this:<br>
><br>
> {<br>
> ...<br>
>    sprintf(title, "%s [%s] %s", r->connection->addr_text.data,<br>
> r->headers_in.server.data, r->request_line.data);<br>
>    memcpy(ngx_os_argv[0], title, MAXBUF);<br>
>    return NGX_DECLINED;<br>
> }<br>
><br>
> Question is, how to solve this problem to update ngx_os_argv[0] if using<br>
> together with proxy_pass? Seems it bypass my 'handler' if using proxy_pass.<br>
> Maybe there is some kind of sequence of loading modules?<br>
<br>
>From what you write it looks like you've installed your code as a<br>
content handler.  You should instead use something like postread<br>
phase handler, see e.g. realip module for an example.  But, well,<br>
it's not going to work anyway, see above.<br>
<br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" target="_blank">http://nginx.org/</a><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 30 May 2014 11:55:40 +0930<br>
From: Andrew Williams <<a href="mailto:sobakasu@gmail.com">sobakasu@gmail.com</a>><br>
To: <a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
Subject: Re: [PATCH] append "-gzip" to etags processed by<br>
        gzip_filter_module + not modified support<br>
Message-ID:<br>
        <CAGiUbyJLmUnvnfWwnNbX1eDNaixUaWEDTOOns=<a href="mailto:rth9TG7-zZiQ@mail.gmail.com">rth9TG7-zZiQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Hi,<br>
<br>
> On Wed, May 28, 2014 at 04:26:04PM +0930, Andrew Williams wrote:<br>
><br>
>> this patch modifies the etag header returned by responses processed by<br>
>> the gzip filter, appending "-gzip" to the etag (instead of deleting<br>
>> it). Also, If-None-Match and If-Match requests work against the<br>
>> modified etag.<br>
>> (the gunzip module appends "-gunzip" to the etag).<br>
><br>
> This approach is wrong, as resources with the same etag are not<br>
> guaranteed to be equal.<br>
<br>
thanks for the feedback - only stripping strong etags looks like a<br>
good solution. looking forward to seeing the weak etag code making it<br>
in.<br>
cheers<br>
Andrew<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
<br>
End of nginx-devel Digest, Vol 55, Issue 34<br>
*******************************************<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Donatas<br>
</div>