Enabled ipv6. Now ipv4 IP's are logged differently

Maxim Dounin mdounin at mdounin.ru
Tue May 29 08:31:25 UTC 2012


Hello!

On Tue, May 29, 2012 at 04:15:02AM -0400, Evert wrote:

> Hi all,
> 
> I've enabled IPv6 support on my Nginx setup, but for some reason that
> has changed the format in which IPv4 addresses are logged...
> 
> Before:
> 109.247.15.146
> 
> Now:
> ::ffff:109.247.15.146
> 
> Is this... a bug? a feature? Expected behaviour?

It looks like you've aren't enabled ipv6 support, but completely 
switched to ipv6 instead.  And now you see all ipv4 connections as 
ipv4-mapped ipv6 ones.

To preserve ipv4 as is use explicit listen sockets on ipv4 and 
ipv6, i.e.

    listen 80;
    listen [::]:80 ipv6only=on;

(the "ipv6only=on" flag is required if your system by default 
tries to handle both ipv6 and ipv4 with ipv6 sockets, and doesn't 
allow ipv4 socket to coexist with it; i.e. it's required on most 
Linux systems)

Maxim Dounin



More information about the nginx mailing list