nginx-devel Digest, Vol 55, Issue 34

Donatas Abraitis donatas.abraitis at gmail.com
Fri May 30 12:55:15 UTC 2014


Hey,

I solved my 'problem' with using post_action after proxy_pass. Thank you.


On Fri, May 30, 2014 at 3:00 PM, <nginx-devel-request at nginx.org> wrote:

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



-- 
Donatas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20140530/31ee8a1f/attachment.html>


More information about the nginx-devel mailing list