From 7bc200621aabc8737241fb26cf0d3401d4ca85f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Mon, 23 May 2022 10:16:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9set=5Freal=5Fip=5Ffrom=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker_env/nginx/my.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker_env/nginx/my.conf b/docker_env/nginx/my.conf index 8ab724f..c2f3310 100644 --- a/docker_env/nginx/my.conf +++ b/docker_env/nginx/my.conf @@ -7,7 +7,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; - set_real_ip_from 177.7.0.0/16; + set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; root /usr/share/nginx/html; index index.html index.php index.htm; @@ -18,7 +18,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - set_real_ip_from 177.7.0.0/16; + set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; rewrite ^/api/(.*)$ /$1 break; #重写 proxy_pass http://177.7.0.12:8000/; # 设置代理服务器的协议和地址