Browse Source

fix: ipv6 on nginx

master
Dnomd343 4 years ago
parent
commit
202788c9ce
  1. 2
      conf/nginx/README.md
  2. 2
      conf/nginx/methodA/ip.conf
  3. 2
      conf/nginx/methodB/ip.conf

2
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

2
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;

2
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;

Loading…
Cancel
Save