This commit is contained in:
Chu Văn Hải committed 2026-07-07 20:51:54 +07:00
1 parent 97530237c6
commit abcb86cfdb
1 file changed
+46
+46
View File
@@ -214,6 +214,52 @@ curl -i http://localhost:9180/apisix/admin/routes/ssm-vn-dev-route \
}'
```
```bash
curl -i http://localhost:9180/apisix/admin/routes/app-service-route \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
-H 'Content-Type: application/json' \
-X PUT \
-d '{
"uri": "/app-service/*",
"name": "app-service-route",
"plugins": {
"key-auth": {},
"real-ip": {
"source": "client_real_ip",
"trusted_addresses": [
"127.0.0.1",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16"
],
"recursive": true
},
"proxy-rewrite": {
"regex_uri": [
"^/app-service(/.*)$",
"$1"
],
"headers": {
"X-API-Key": "yREuD0YYtD9M6699"
}
},
"limit-count": {
"count": 100,
"time_window": 60,
"rejected_code": 429
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"service.tntechglobal.io.vn:443": 1
},
"pass_host": "node",
"scheme": "https"
}
}'
```
> [!IMPORTANT]
> **Giải thích tham số cấu hình Upstream:**
> * `pass_host: "node"`: Bắt buộc cấu hình trường này để APISIX ghi đè giá trị header `Host` gửi tới Dynamics 365 trùng khớp với node URL (`<YOUR_ORG>.crm.dynamics.com`). Nếu thiếu, Dynamics 365 sẽ từ chối xử lý request vì host header không khớp.