IPv4 & IPv6
mdounin at mdounin.ru
Fri Apr 5 21:43:31 UTC 2013
On Fri, Apr 05, 2013 at 04:17:09PM -0400, B.R. wrote:
> I noticed in an article dedicated to the subject
> to allow Nginx to listen both on IPv4 and IPv6 interfaces
> simultaneously, you needed to set sysctl with the following configuration
> (otherwise Nginx listening binds conflict one with each other):
> net.ipv6.bindv6only = 1
> However, this has conflicting and unwanted effects on other applications
> such as Java.
> Is there any other way to allow Nginx ot listen on both interface types
> without mandatory system configuration?
There is "ipv6only" parameter of the "listen" directive, which
allows to listen on ipv6 and ipv4 sockets reliably and
simulteniously regardless of the system configuration.
listen [::]:80 ipv6only=on;
will do the trick.
As of nginx 1.3.x, the ipv6only=on is used by default and there is
no need to specify it explicitly.
See http://nginx.org/r/listen for more details.
More information about the nginx