【问题标题】:Does NginX for Windows support IPv6?NginX for Windows 是否支持 IPv6?
【发布时间】:2020-05-17 10:25:00
【问题描述】:

我与:

  • NginX(版本 1.17.9)
  • 在 Windows Server 2016 上。

NginX 适用于 IPv4 IP 地址,但不适用于 IPv6 IP 地址。当我输入

nginx -V 

在 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

在上面的配置设置中,我没有看到 NginX IPv6 支持声明:with-ipv6

在 nginx.conf 文件中,以下语句可以正常工作:

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

当我把它改成:

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

它不再起作用了。

我已经为我的域中的 IPv6 地址添加了 AAAA 记录。互联网域检查证实了这一点:

https://ip6.nl/

我的问题:

  1. NginX for Windows 是否支持 IPv6?
  2. 如何在 NginX for Windows 中启用 IPv6 支持。

【问题讨论】:

    标签: windows nginx ipv6


    【解决方案1】:

    感谢所有帮助。我发现无法访问我的 IPv6 地址有两个原因:

    • 我的防火墙不允许通过 IPv6 请求。我添加了一条规则 IPv6 地址:我使用 ::/0(= IPv6 相当于 0.0.0.0/0)
    • 无法从 Internet 访问我的 IPv6, 因为网关和 DNS 没有正确配置。我通过在服务器上测试我的 IP 发现了这一点:http://whatismyip.com

    所以,“NginX for Windows 是否支持 IPv6”这个问题的答案是肯定的!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-05
      • 2012-07-26
      • 2014-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多