proxy - 使用 Istio 出口网关或 ServiceEntry 将 HTTP 请求代理到外部代理
问题描述
我正在尝试使用 Istio egress gateway+ServiceEntry 或 ServiceEntry+VirtualService 将 HTTP 请求代理到外部代理,在将请求路由到外部代理之前添加一个 HTTP 标头,但我没有找到类似的示例。
可能吗 ?
我已经证明了不同的配置,但它们不起作用。
例如:
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: proxy
namespace: lab
spec:
hosts:
- externalproxy
location: MESH_EXTERNAL
ports:
- number: 3128
name: http
protocol: HTTP
resolution: DNS
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: proxy-virtualservice
namespace: lab
spec:
hosts:
- myservice
http:
- match:
port: 3128
rewrite:
authority: externalproxy
route:
- destination:
host: externalproxy
port:
number: 3128
headers:
request:
add:
myheader: test
谢谢
解决方案
推荐阅读
- django - 使用 Reversion 应用程序 (DJANGO) 时如何从辅助模型中恢复文件
- html - 字体粗细不适用于下载的字体
- python - 十进制数列表输入
- java - 使用自动装配时,抽象类对象的子类为空
- r - 有没有办法在 R kable 的“column_spec”函数中添加乳胶规范?
- python - Tkinter 画布中的图像
- android - NestedScrollView 不使用 CoordinatorLayout 滚动
- javascript - 如何在“数字”输入字段中设置分钟,它应该只接受 0 到 59 的值
- oracle - 如何将 DBMS_METADATA Oracle 转换为 Postgres?
- vba - 逐页将每个 Word 表格从源文档复制到目标文档