0
votes

The title is just what I think I need

I'm looking for a clean way to forward a request through a jump box gateway server. The gateway server is a jump box with access to production. The jump box has access to the services I need, and I have access to the jump box via web browser.

These http services are accessible from the cli of the jumpbox via curl via haproxy and some firewall rules. Currently the requests are going to a vip address which is another set of HAproxies that are using backend depending on what the Host header of the request is. One for one service one for another.

Is there a way for me to cleanly expose these services so that I can somehow request them from the jump box listening nginx instance and they are passed to haproxy with the appropriate Host header and then returned to my web browser?

Is there an easier, cleaner or faster way to go about this?

path again is:

I have access to jump box web front

This part works Internal network > jumpbox webui on nginx > link to service webfronts

The nginx instance is basically a flat html page with links to other pages. I'd prefer if a link on here could be forwarded or a request made back to nginx in order to reach through the haproxy.

jumpbox has access to prod

This part works internal network > jumpbox haproxy > production haproxy > listening request and using back end based on Host header

But what I don't have is a way to get access to it from my web browser directly.

From the jump box this works

####### myService ########

  acl acl-myservice1 hdr_beg(host) -i myservice1.mycompany.com
  use_backend myservice1 if acl-myservice1 

  acl acl-myservice2 hdr_beg(host) -i myservice2.mycompany.com
  use_backend myservice2 if acl-myservice2

## BACKENDS
  backend myservice1
  server prdproxy-vip01                myservice1.mycompany.com:80

  backend myservice2
  server prdproxy-vip01                myservice2.mycompany.com:80

And prdproxy-vip is shuffling things in the right direction based on that the name myservice1.mycompany.com myservice2.mycompany.com. Note also that these names are resolved via the hosts file.

1

1 Answers

0
votes

I actually solved this but it feels like such a hack so I'm open to suggestions on improving it.

  1. jumpbox webui link points back to jumpboxip/service1
  2. nginx uses proxy_pass to pass path_beg /service1 to haproxy
  3. haproxy routes requests for /service1 to the production network
  4. production haproxies have acl for /service1 and choose appropriate backend

Not the since serivce1 is a webfront, it makes it's own requests for all the static contents so I had to provide 2 rules for this to work in the haproxies

  • jumpbox haproxy
    • jumpboxip/service1
    • jumpboxip/static
    • choose production backend
  • production haproxy
    • jumpboxip/service1 I had to replace /service1 with / on the backend
    • jumpboxip/static
    • choose service backend