Kubernetes Using Proxy without ingress

5/23/2019

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. I want to use link wwww.example.com. How should I tell nginx to proxy the connection on wwww.example.com (which is a different app). 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.

-- Danny
kubernetes
nginx
reverse-proxy

1 Answer

6/5/2019

If I understood your request correctly, you may just use return directive in your nginx config

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

-- A_Suh
Source: StackOverflow