IPv6 & IPv4 backend with proxy_bind

SplitIce mat999 at gmail.com
Fri Nov 22 13:40:06 UTC 2013


Ruslan, its funny you should mention this, I am testing a patch to do just
that at the moment.

Once I am certain that its not leaking memory and I have reviewed it in
regards to the nginx code standards Ill post it in this email thread in
case it is of use for others.


On Fri, Nov 22, 2013 at 11:56 PM, Ruslan Ermilov <ru at nginx.com> wrote:

> On Tue, Nov 19, 2013 at 09:09:34PM +1030, SplitIce wrote:
> > An IPv6 based fallback is not the only solution we want to support,
> > ultimately we would like to be able to load-balance between them as well.
> > An error_page based solution would not assist.
> >
> > I also get the feeling that such a hack would have large implications,
> > while either an additional parameter or another directive would be a
> simple
> > & clean solution to a real identified deficiency.
> >
> > This kind of request is only going to get more common with the growing
> > adoption of IPv6.
>
> You can make the currently selected peer address available as an nginx
> variable, then use the "map" directive to compute the per-peer bind
> address, like follows:
>
> map $peer_addr $bind_addr {
>     192.168.1.100  192.168.1.1;
>     2001:0db8::100 2001:0db8::1;
>     ...
> }
>
> or like this:
>
> map $peer_addr $bind_addr {
>     ~:      2001:0db8::1;
>     default 192.168.1.1;
> }
>
> Hint: the "proxy_bind" directive supports variables.
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20131123/83f2bdfb/attachment.html>


More information about the nginx-devel mailing list