OpenResty IPV6 看了下,好像 没有IPV6的模块,

问答中心分类: NginxOpenResty IPV6 看了下,好像 没有IPV6的模块,
cc asked 6 年 ago
openresty 是不是没有把 ipv6 编译进去哈. 
configure arguments:
--prefix=/usr/local/openresty/nginx --with-cc-opt=-O2
--add-module=../ngx_devel_kit-0.3.0
--add-module=../echo-nginx-module-0.61
--add-module=../xss-nginx-module-0.06
--add-module=../ngx_coolkit-0.2rc3
--add-module=../set-misc-nginx-module-0.32
--add-module=../form-input-nginx-module-0.12
--add-module=../encrypted-session-nginx-module-0.08
--add-module=../srcache-nginx-module-0.31
--add-module=../ngx_lua-0.10.13
--add-module=../ngx_lua_upstream-0.07
--add-module=../headers-more-nginx-module-0.33
--add-module=../array-var-nginx-module-0.05
--add-module=../memc-nginx-module-0.19
--add-module=../redis2-nginx-module-0.15
--add-module=../redis-nginx-module-0.3.7
--add-module=../rds-json-nginx-module-0.15
--add-module=../rds-csv-nginx-module-0.09
--add-module=../ngx_stream_lua-0.0.5
--with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -ljemalloc'
--user=www --group=www --with-http_stub_status_module
--with-http_v2_module --with-http_ssl_module
--with-http_gzip_static_module
--with-http_realip_module
--with-http_flv_module
--with-http_mp4_module
--with-openssl=/root/oneinstack/src/openresty-1.13.6.2/../openssl-1.0.2o
--with-pcre=/root/oneinstack/src/openresty-1.13.6.2/../pcre-8.42
--with-pcre-jit
--add-module=/root/oneinstack/src/openresty-1.13.6.2/../ngx_cache_purge-2.3
--with-stream --with-stream_ssl_module

3 Answers
oneinstack answered 6 年 ago

--with-ipv6参数很早就已经取消,默认就编译在nginx中,自己配置即可。
http://nginx.org/en/CHANGES
Changes with nginx 1.11.5 11 Oct 2016
*) Change: the --with-ipv6 configure option was removed, now IPv6
support is configured automatically.

cc answered 6 年 ago
修改域名对应的conf 监听端口 80/443

server {
  listen [::]:80;
  listen [::]:443 ssl http2;
nginx -t
service nginx restart/reload

用国外主机PING6 是正常显示有IPV6地址,
但是用浏览器访问的时候,
显示403

oneinstack answered 6 年 ago

浏览器所在主机是走ipv6吗?这种问题不用提交了!
nginx配置ipv6 正常,证明模块没问题