Welcome! Log In Create A New Profile

Advanced

handler before proxy-pass

Donatas Abraitis
May 29, 2014 08:06AM
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
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

handler before proxy-pass

Donatas Abraitis 675 May 29, 2014 08:06AM

Re: handler before proxy-pass

Maxim Dounin 407 May 29, 2014 08:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 134
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready