小编Nat*_*tan的帖子

如何重写 url 到后端,同时在 nginx 入口中保留浏览器 url?

我正在尝试重写服务的路径,同时在 kubernetes 上使用 nginx 入口保留浏览器 URL。

我需要的是这样的:

  • http://example.com/path=>http://service
  • http://example.com/path/bar=>http://service/bar
  • http://example.com/path/file.css=>http://service/file.css

也就是说,使其/path成为上游服务器中的根(或某个不同的 url)。

从我在这里看到的,这是使用 proxy_pass 上的尾部斜杠来完成的,但 nginx ingress 似乎没有这个选项。

这可能是 nginx 入口吗?

nginx kubernetes nginx-ingress

15
推荐指数
1
解决办法
4万
查看次数

标签 统计

kubernetes ×1

nginx ×1

nginx-ingress ×1