Openshift - Internal NGINX proxy can't connect to Openshift route hostname Openshift - Internal NGINX proxy can't connect to Openshift route hostname nginx nginx

Openshift - Internal NGINX proxy can't connect to Openshift route hostname


When you want to make a request to some other application running in the same OpenShift cluster, the correct solution in most cases is to use the internal DNS.

OpenShift ships with a SDN which enables comms between Pods. This is more efficient than communicating to another Pod via its route since this will typically route the request back onto the public internet before it hits the OpenShift router again and is at that point forwarded via the SDN.

Services can be reached <service>.<pod_namespace>.svc.cluster.local which in your case enables NGINX to proxy via server apps1-1-0.myproject.svc.cluster.local

Routes should typically be used to route external traffic into the cluster.

See OpenShift docs for more details on networking


Per a comment above, I ended up dropping the route and referencing the service's internal DNS in NGINX's upstream:

upstream finder-ui-1-0 {                                                                                                                                                                     server apps1-1-0.myproject.svc.cluster.local:443;                                                                                                                                }             

This suited my needs just fine and worked well.