[英]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.