简体   繁体   English

NginX 为 Windows 是否支持 IPv6?

[英]Does NginX for Windows support IPv6?

I work with:我与:

  • NginX (version 1.17.9) NginX(版本 1.17.9)
  • on Windows Server 2016.在 Windows 服务器 2016 上。

NginX works fine with IPv4 IP adresses, but it does not work with IPv6 IP addresses. NginX 适用于 IPv4 IP 地址,但不适用于 IPv6 IP 地址。 When I type当我打字时

nginx -V 

from the dos command prompt, I see the following listing:在 dos 命令提示符下,我看到以下清单:

C:\nginx1_17\nginx-1.17.9>nginx -V

nginx version: nginx/1.17.9
built by cl 16.00.40219.01 for 80x86
built with OpenSSL 1.1.1d  10 Sep 2019
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre-8.44 --with-zlib=objs.msvc8/lib/zlib-1.2.11 --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-openssl=objs.msvc8/lib/openssl-1.1.1d --with-openssl-opt='no-asm no-tests -D_WIN32_WINNT=0x0501' --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module

In the configuration settings above, I don't see the NginX IPv6 support statement: with-ipv6 .在上面的配置设置中,我没有看到 NginX IPv6 支持声明: with-ipv6

in the nginx.conf file the following statements works fine:在 nginx.conf 文件中,以下语句工作正常:

server{
        #IPv4
        listen 443 ssl; 
        server_name  mywebsite.com;
        {
        location /
         root html;
         index index.html;
         }
      }

When I change it to:当我将其更改为:

server{
        #IPv6
        listen [::]:443 ssl;
        server_name  mywebsite.com;
        {
        location /
         root html;
         index index.html;
         }
      }

it does NOT work anymore.它不起作用了。

I've already added a AAAA record for the IPv6 address in my domain.我已经在我的域中为 IPv6 地址添加了 AAAA 记录。 This is confirmed by the inte.net domain check at: inte.net 域检查确认了这一点:

https://ip6.nl/ https://ip6.nl/

My questions:我的问题:

  1. Does NginX for Windows support IPv6? NginX 为 Windows 是否支持 IPv6?
  2. How to enable IPv6 support in NginX for Windows.如何在 NginX 中为 Windows 启用 IPv6 支持。

Thanks for all the help.感谢所有的帮助。 I discovered my IPv6 address was not accessible for 2 reasons:我发现我的 IPv6 地址无法访问,原因有两个:

  • My firewall did not let pass IPv6 requests.我的防火墙不允许通过 IPv6 请求。 I added a rule for the IPv6 adresses: I used::/0 (= IPv6 equivalent of 0.0.0.0/0)我为 IPv6 地址添加了一条规则:我使用了::/0(= IPv6 等同于 0.0.0.0/0)
  • My IPv6 was not reacheable from the inte.net, because the gateway and the DNS were not properly configured.我的 IPv6 无法从 inte.net 访问,因为网关和 DNS 没有正确配置。 I discovered this by testing my IP from the server at: http://whatismyip.com我通过从服务器测试我的 IP 发现了这一点: http://whatismyip.com

So, the answer to the question: 'does NginX for Windows supports IPv6' is yes!所以,问题的答案是:“Windows 的 NginX 是否支持 IPv6”是肯定的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM