IPv4 & IPv6
B.R.
reallfqq-nginx at yahoo.fr
Sat Apr 6 06:25:54 UTC 2013
Hello,
It seems I solved the problem...
It was indeed by reading a little more carefully the doc
http://wiki.nginx.org/HttpCoreModule#listen, thanks @Lukas! ;o)
The '*:80' syntax is used for IPv4 listening, I don't understand why it
works as-is for you Ted. Maybe Maxim will be of a better help on that case.
It is said that the IPv6 syntax will make Nginx listen for the 6to4 IP
address syntax, making the websites reachable through IPv4, even if no
specific IPv4 binding exist for the listening sockets.
Using:
listen [::]:80;
I have:
$ sudo ss -lnp|grep nginx
0 128 :::80
:::* users:(("nginx",***,11),("nginx",***,11))
0 128 :::443
:::* users:(("nginx",***,12),("nginx",***,12))
You shall *not* have 2 'listen' directive if you did not separate you IPv6
and IPv4 stacks (with the sysctl net.ipv6.bindv6only directive set to 1).
I had that configuration before, but the sysctl configuration has an impact
on the whole system and also on Java which, when listening on IPv6, seems
not to be reachable through 6to4 syntax.
I still need to confirm my websites are accessible in the same fashion with
IPv4 or IPv6, but I guess my trouble comes from bad IPv6 routing, not from
the webserver.
Thanks for your input, everyone!
---
*B. R.*
On Fri, Apr 5, 2013 at 8:48 PM, B.R. <reallfqq-nginx at yahoo.fr> wrote:
> Hmm...
>
> @Maxim
> I guess I haven't understood your piece of advice, since 'listen' can only
> be used in 'server' directive...
> What is it you wanted me to try, again? :oD
> ---
> *B. R.*
>
>
> On Fri, Apr 5, 2013 at 8:02 PM, B.R. <reallfqq-nginx at yahoo.fr> wrote:
>
>> I have indeed several virtual servers.
>>
>> I have a specific one which serves different content whether a client
>> connects in HTTP or HTTPS (basically the HTTP content provides directions
>> for the HTTPS setup).
>> I also have one virtual server which I want listening on IPv4 only, not
>> IPv6.
>>
>> That's why I prefer managing the listen directives in virtual servers
>> rather than in the 'http' directive block.
>>
>> Is there no other mean than using global 'listen' directives?
>> ---
>> *B. R.*
>>
>>
>> On Fri, Apr 5, 2013 at 6:21 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>>
>>> Hello!
>>>
>>> On Fri, Apr 05, 2013 at 06:07:23PM -0400, B.R. wrote:
>>>
>>> > Hello,
>>> >
>>> > @Maxim
>>> > I tried the duplicate configuration entries:
>>> > listen 80;
>>> > listen [::]:80 ipv6only=on;
>>> >
>>> > I has the following error:
>>> > nginx: [emerg] duplicate listen options for [::]:80 in
>>> > /etc/nginx/conf.d/***.conf:3
>>>
>>> If you have multiple virtual server{}s with the same listening
>>> sockets used, you have to specify listening options in a single listen
>>> directive only.
>>>
>>> That is, add "ipv6only=on" to a listen directive in first/default
>>> server in your configuration. This will do the trick.
>>>
>>> --
>>> Maxim Dounin
>>> http://nginx.org/en/donation.html
>>>
>>> _______________________________________________
>>> nginx mailing list
>>> nginx at nginx.org
>>> http://mailman.nginx.org/mailman/listinfo/nginx
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130406/d6b8104a/attachment.html>
More information about the nginx
mailing list