How do I run oauth2-proxy on a system behind a port-forwarding firewall?

41 Views Asked by At

Would like to know how to config oauth2-proxy so it listens on (binds to) a hort:port (or a set of host:port combinations) other than the one specified in the config's http-address, i. e. so if it's running w/http-address set to my.publicdomain.com, it can listen for connections on systemX in a private network on localhost:4180 (binding to ::1:4180, 127.0.0.1:4180).

The effect would be for the proxy to receive HTTP GET/POST calls w/the "Host" header as my.publicdomain.com, w/the actual TCP traffic to the proxy being sent on port 4180.

That way, if oauth2-proxy is behind a simple port-forwarding firewall that redirects traffic from my.publicdomain.com:80 -> systemX:4180 (as opposed to a reverse proxy like nGinx that can transform the host header and port in an HTTP request), users can access it on the outside via http://my.publicdomain.com.

Currently, there doesn't appear to be any config option that allows this.

Of course, if oauth2-proxy simply ignores the "Host" header in an HTTP request (i. e. doesn't check if the host:port specified in that header matches the host:port specified for "http-address" in the config), then this would be possible, albeit insecure

0

There are 0 best solutions below