From 914c009182af295bed4eb5b263c46793a50b4ab4 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Fri, 28 Oct 2022 18:57:01 +0800 Subject: [PATCH] docs: add `X-Real-IP` header in nginx configure --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9ee1b43..57ebbe0 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ server { if ($http_user_agent !~* (curl|wget)) { # 来自非命令行的请求,重定向到https return 301 https://$server_name$request_uri; } + proxy_set_header X-Real-IP $remote_addr; # 反向代理转发真实IP proxy_set_header Host $http_host; # 反向代理转发当前域名 proxy_pass http://127.0.0.1:1689; } @@ -150,6 +151,7 @@ server { gzip_vary on; location / { + proxy_set_header X-Real-IP $remote_addr; # 反向代理转发真实IP proxy_set_header Host $http_host; # 反向代理转发当前域名 proxy_pass http://127.0.0.1:1689; }