1.nigin添加一段配置
server {
listen 80;
# this is the key !!!!! proxy_set_header Host $host; location /client/pids { proxy_pass http://10.103.13.103:3200/client/pids; } location /interface/client/pids { proxy_pass http://10.103.13.103:3200/interface/client/pids; } ......
2.gateway網關配置
有一個過濾器PreserveHostHeaderGatewayFilter,用來在gateway轉發請求的時候把原始請求的host頭部帶上,轉發給目標服務。
- id: auth-service
uri: lb://auth-service
predicates:
- Path=/api/auth/**,/api/oauth/dd/**
filters:
- StripPrefix=1
- PreserveHostHeader #發送網關原始主機頭:
轉自:https://www.cnblogs.com/abu1314/articles/13123654.html