【发布时间】: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 记录。互联网域检查证实了这一点:
我的问题:
- NginX for Windows 是否支持 IPv6?
- 如何在 NginX for Windows 中启用 IPv6 支持。
【问题讨论】: