Browse Source

Merge pull request #1629 from Algustine/dev

fix: get real-ip instead of vercel edge network ip
Yifei Zhang 1 year ago
parent
commit
b0b078c0fb
1 changed files with 20 additions and 1 deletions
  1. 20 1
      vercel.json

+ 20 - 1
vercel.json

@@ -1,5 +1,24 @@
 {
     "github": {
         "silent": true
-    }
+    },
+    "headers": [
+        {
+            "source": "/(.*)",
+            "headers": [
+                {
+                    "key": "X-Real-IP",
+                    "value": "$remote_addr"
+                },
+                {
+                    "key": " X-Forwarded-For",
+                    "value": "$proxy_add_x_forwarded_for"
+                },
+                {
+                    "key": "Host",
+                    "value": "$http_host"
+                }
+            ]
+        }
+    ]
 }