相关疑难解决方法(0)

Istio 虚拟服务 - 外部 HTTPS 服务的代理

我正在尝试将具有指定 URI 前缀的 HTTP 请求代理到外部 HTTPS 服务器。这个想法是使用 NPM 的内部 Nexus 存储库管理器,但不要像GitHub 项目那样放弃“npm 审计”的能力。应该使用 Istio 来完成,而不是部署额外的应用程序。

我配置了一个虚拟服务和一个服务条目以将流量路由到外部服务。到目前为止,还无法将 HTTP 请求转换为 HTTPS 请求。有机会这样做吗?

配置:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: vs-nexus
spec:
  hosts:
  - "test.com"
  gateways:
  - gateway-xy
  http:
  - match:
    - uri:
        prefix: /-/npm/v1/security/audits/
    route:
      - destination:
          port:
            number: 443
          host: registry.npmjs.org
  - route:
    - destination:
        port:
          number: 80
        host: nexus


---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: npmjs-ext
spec:
  hosts:
    - registry.npmjs.org
  ports:
    - number: 443
      name: tls
      protocol: …
Run Code Online (Sandbox Code Playgroud)

nexus istio npm-audit istio-gateway

0
推荐指数
1
解决办法
2028
查看次数

标签 统计

istio ×1

istio-gateway ×1

nexus ×1

npm-audit ×1