简体   繁体   English

Kubernetes使用代理而无需入口

[英]Kubernetes Using Proxy without ingress

My issue is that I have a web server running on port 80. I want to use nginx proxy (not the ingress) bto redirect the connection. 我的问题是我有一个在端口80上运行的Web服务器。我想使用nginx代理(而不是入口)来重定向连接。 I want to use link wwww.example.com. 我想使用链接wwww.example.com。 How should I tell nginx to proxy the connection on wwww.example.com (which is a different app). 我应该如何告诉nginx在wwww.example.com(这是一个不同的应用程序)上代理连接。 I tried using service with load balancer but it changes the hostname ( to some aws link) I need it to be exactly wwww.example.com. 我尝试使用带负载均衡器的服务,但它更改了主机名(到某些aws链接)我需要它完全是wwww.example.com。

If I understood your request correctly, you may just use return directive in your nginx config 如果我正确理解了您的请求,您可以在nginx配置中使用return指令

server {
    listen 80;
    server_name www.some-service.com;
    return 301 $scheme://wwww.example.com$request_uri;
}

If you need something more complex check this doc or this 如果您需要更复杂的东西,请查看文档或文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Ingress 在 kubernetes 上的 s3 代理 - s3 proxy on kubernetes using Ingress 使用 kubernetes nginx-ingress 反向代理具有 SNI 支持的站点 - Reverse proxy a site with SNI support using kubernetes nginx-ingress can I use nginx ingress controller oauth2_proxy in kubernetes with azure active directory without cookies - can I use nginx ingress controller oauth2_proxy in kubernetes with azure active directory without cookies 使用 nginx 代理动态进入 Kubernetes 服务 - dynamic ingress to Kubernetes services with nginx proxy 在Kubernetes入口之前的Nginx反向代理 - Nginx reverse proxy in front of a Kubernetes Ingress Kubernetes nginx ingress代理传递给websocket - Kubernetes nginx ingress proxy pass to websocket Kube.netes Ingress 在 nginx 反向代理后面运行 - Kubernetes Ingress running behind nginx reverse proxy 使用 Ingress Kubernetes 公开流量 - Expose traffic using Ingress Kubernetes 如何创建将流量转发到 kube.netes ingress controller 的反向代理,例如 haproxy ingress 或 nginx ingress - How to create reverse proxy that forward traffic to kubernetes ingress controller such as haproxy ingress or nginx ingress Kubernetes nginx 入口重定向没有路径前缀 - Kubernetes nginx ingress redirects without path prefix
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM