From 202788c9cee2a3e67f17704d5d3930df0e5d4e61 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 18 Mar 2021 00:53:19 +0800 Subject: [PATCH] fix: ipv6 on nginx --- conf/nginx/README.md | 2 +- conf/nginx/methodA/ip.conf | 2 ++ conf/nginx/methodB/ip.conf | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/nginx/README.md b/conf/nginx/README.md index 51435a9..d2f3390 100644 --- a/conf/nginx/README.md +++ b/conf/nginx/README.md @@ -10,7 +10,7 @@ shell> cd /etc/nginx/conf.d # 从代码仓库复制配置文件 shell> cp /var/www/echoIP/conf/nginx/methodA/ip.conf ./ -shell> cp /var/www/echoIP/conf/nginx/methodB/ip-sub.func ./ +shell> cp /var/www/echoIP/conf/nginx/methodA/ip-sub.func ./ # 修改配置文件,将ip.343.re改为需要部署的域名 shell> vim ip.conf diff --git a/conf/nginx/methodA/ip.conf b/conf/nginx/methodA/ip.conf index a63166a..d931abc 100644 --- a/conf/nginx/methodA/ip.conf +++ b/conf/nginx/methodA/ip.conf @@ -1,11 +1,13 @@ server { listen 80; + listen [::]:80; server_name ip.343.re; # 改为自己的域名 include conf.d/ip-sub.func; } server { listen 443 ssl http2; + listen [::]:443 ssl http2; server_name ip.343.re; # 改为自己的域名 ssl_certificate /etc/ssl/certs/343.re/fullchain.pem; # 改为自己的证书 ssl_certificate_key /etc/ssl/certs/343.re/privkey.pem; diff --git a/conf/nginx/methodB/ip.conf b/conf/nginx/methodB/ip.conf index 6326d6c..429256a 100644 --- a/conf/nginx/methodB/ip.conf +++ b/conf/nginx/methodB/ip.conf @@ -1,5 +1,6 @@ server { listen 80; + listen [::]:80; server_name ip.343.re; # 改为自己的域名 location / { if ($http_user_agent !~* (curl|wget)) { @@ -12,6 +13,7 @@ server { server { listen 443 ssl http2; + listen [::]:443 ssl http2; server_name ip.343.re; # 改为自己的域名 ssl_certificate /etc/ssl/certs/343.re/fullchain.pem; # 改为自己的证书 ssl_certificate_key /etc/ssl/certs/343.re/privkey.pem;