我使用的是
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是否支持IPv6?
谢谢大家的帮助。我发现我的IPv6地址无法访问有两个原因。
所以,对于 "NginX for Windows是否支持IPv6 "这个问题,答案是肯定的。