# IPv6 fails for set\_real\_ip\_from in 1.2.1

**URL:** <https://www.ruby-forum.com/t/ipv6-fails-for-set-real-ip-from-in-1-2-1/220479>\
**Category:** NGINX\
**Created:** [June 11, 2012, 3:00pm UTC](https://www.ruby-forum.com/t/ipv6-fails-for-set-real-ip-from-in-1-2-1/220479 "2012-06-11T15:00:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 11, 2012, 3:00pm UTC](https://www.ruby-forum.com/t/ipv6-fails-for-set-real-ip-from-in-1-2-1/220479/1 "2012-06-11T15:00:24Z")

</div>

I noticed in the 1.2.1 changelog that set\_real\_ip\_from is supposed to  
support IPv6 addresses. Unfortunaly I get a configuration error when I  
try it.

This works fine:  
set\_real\_ip\_from 127.0.0.1;  
real\_ip\_header X-Forwarded-For;

This fails:  
set\_real\_ip\_from 127.0.0.1;  
set\_real\_ip\_from ::1;  
real\_ip\_header X-Forwarded-For;

$ nginx -t  
nginx: [emerg] invalid parameter “::1” in nginx.conf:22  
nginx: configuration file nginx.conf test failed

Posted at Nginx Forum:

> **[IPv6 fails for set\_real\_ip\_from in 1.2.1](https://forum.nginx.org/read.php?2,227430,227430#msg-227430)**
>
> I noticed in the 1.2.1 changelog that set\_real\_ip\_from is supposed to support IPv6 addresses. Unfortunaly I get a configuration error when I try it. This works fine: set\_real\_ip\_from 127.0.0.1; real\_ip\_header X-Forwarded-For; This fails: set\_real\_ip

---

<div class="post-metadata">

**Author:** ![dakrer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5a626/32.png) [@dakrer](https://www.ruby-forum.com/u/dakrer)\
**Post date:** [June 11, 2012, 9:30pm UTC](https://www.ruby-forum.com/t/ipv6-fails-for-set-real-ip-from-in-1-2-1/220479/2 "2012-06-11T21:30:17Z")

</div>

On Mon, Jun 11, 2012 at 08:59:38AM -0400, dakrer wrote:

> set\_real\_ip\_from ::1;  
> real\_ip\_header X-Forwarded-For;
> 
> $ nginx -t  
> nginx: [emerg] invalid parameter “::1” in nginx.conf:22  
> nginx: configuration file nginx.conf test failed

For IPv6 to work, nginx should be built with --with-ipv6.
