On Wed, Dec 01, 2010 at 02:24:24PM -0500, David J. wrote:
server_name domain1.com;
}
But according to that post it has been included in 8.39 I am using 8.53
What OS do you use ?
This
listen 80;
listen [::]:80 ipv6only=on;
should work, however, if you add “ipv6only=on” to existant configuration
and reload it using -HUP, then it does not work. You should stop nginx
and start it again due to the IPV6_V6ONLY option behaviour.
AFAIK, it depends on what type of sockets your OS support, IPv4 only,
IPv4+IPv6 hybrid or IPv4 and IPv6 separate.
If you’re in a OS that supports hybrid sockets then it seems that your
config is incorrect, in the sense that it assumes separate IPv6 and
IPv4 sockets.
Also, AFAIK, Linux uses hybrid sockets by default, while FreeBSD uses
separate sockets for IPv4 and IPv6.
Perhaps someone more knowledgeable than I in OS’ kernel networking
internals can chime in.
ipv6only=on seems to behave the opposite of what it should. I have a
default_server listening on all interfaces. It works fine using
listen [::]:80 default_server;
listen 80 default_server;
but if I do
listen [::]:80 default_server ipv6only=on;
listen 80 default_server;
then I get a bunch of errors about already bound addresses on startup.
net.ipv6.bindv6only is set to 1.
server {
listen [::]:80 default_server;
listen 80 default_server;
return 444;
} #According to docs, this config should fail, because without
ipv6only=on, #this line should automatically listen on ipv4 interfaces also.
server {
listen [::]:80 default_server ipv6only=on;
return 444;
} #I remove the listen 80 line, and add ipv6only=on
/etc/init.d/nginx start
Checking nginx’ configuration …
the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
[ ok ]
Starting nginx …
[emerg]: bind() to [2a01:4f8:130:9101::3]:80 failed (98: Address already
in use)
[emerg]: bind() to [2a01:4f8:130:9101::3]:80 failed (98: Address already
in use)
[emerg]: bind() to [2a01:4f8:130:9101::3]:80 failed (98: Address already
in use)
[emerg]: bind() to [2a01:4f8:130:9101::3]:80 failed (98: Address already
in use)
[emerg]: bind() to [2a01:4f8:130:9101::3]:80 failed (98: Address already
in use)
[emerg]: still could not bind()
start-stop-daemon: failed to start `/usr/sbin/nginx’
Failed to start nginx
[ !! ]
ERROR: nginx failed to start
Not only does it not work as described, it seems to be trying to bind a
specific address multiple times, and maybe succeeding the first time,
because there’s nothing else running on any interface port 80, so it
fails since it can’t successfully bind the same address a second time.
On Mon, Dec 27, 2010 at 10:55:35AM -0500, petteyg359 wrote:
–http-log-path=/var/log/nginx/access_log
–with-http_realip_module --with-http_ssl_module #this line should automatically listen on ipv4 interfaces also.
This shouldn’t fail as long as you have ipv6-only bind as
default in your system. It won’t even fail on OSes where binds on
ipv6 with ipv4 doesn’t conflict with ipv4 explicit binds. This is
unrelated though.
#I remove the listen 80 line, and add ipv6only=on
in use)
[ !! ]
ERROR: nginx failed to start
Not only does it not work as described, it seems to be trying to bind a
specific address multiple times, and maybe succeeding the first time,
because there’s nothing else running on any interface port 80, so it
fails since it can’t successfully bind the same address a second time.
Could you please provide full config which triggers the problem?
In particular, full list of server{} blocks with their “listen”
directives.
If I uncomments the line marked “***1” , the following error occurs:
nginx: [emerg] bind() to [fe80::20c:29ff:fe86:7e4d]:10499 failed (22:
Invalid argument)
If I uncomments the line marked “***2”, the following error occurs:
nginx: [emerg] bind() to [fd41:28b7:be11:0:20c:29ff:fe86:7e4d]:10119
failed (99: Cannot assign requested address)
Could you tell me why these errors occur?
I think simply I forget some important configuration though…
Thanks and regards,
Soichiro MIKI
Maxim D. Wrote:
Could you please provide full config which
triggers the problem?
In particular, full list of server{} blocks with
their “listen”
directives.
Maxim D.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.