Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Maxim Dounin
October 30, 2013 10:18AM
Hello!

On Mon, Oct 28, 2013 at 02:44:45PM -0700, Yichun Zhang (agentzh) wrote:

> Hello!
>
> On Mon, Oct 28, 2013 at 1:41 PM, Maxim Dounin wrote:
> >
> > What's the intended use?
>
> I cannot really speak for my user. But one use case that I can think
> of is for (nonblocking) access logging in Lua, for example, as in
>
> https://github.com/cloudflare/lua-resty-logger-socket
>
> where we can log $proxy_host and $proxy_port to a nonblocking socket in Lua :)

For logging, there is $upstream_addr variable, which is actually
contatains some additional information, while $proxy_host is just
a result of parsing the proxy_pass directive arguments. The
$proxy_host/$proxy_port variables are mostly for use in
proxy_set_header Host, much like $proxy_add_x_forwarded_for.

Note well, that if there is a need to access these
variables from dynamic languages for some reason, it can be easily
done by adding a map{} into a configuration.

I tend to say "no", at least unless a better use case provided.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Yichun Zhang (agentzh) 966 October 27, 2013 06:48PM

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Maxim Dounin 355 October 28, 2013 04:42PM

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Yichun Zhang (agentzh) 361 October 28, 2013 05:46PM

Re: [PATCH] Make $proxy_host and $proxy_port accessible in dynamic languages

Maxim Dounin 437 October 30, 2013 10:18AM



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

Online Users

Guests: 143
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