在 nginx 中可以替换请求中的“Host”标头。
server_name myexample.com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host myendpoint.net;
proxy_pass http://127.0.0.1:8111;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
但是,是否可以将标题和响应正文中的所有匹配“myendpoint.net”替换为“myexample.com”?