fabiolb / fabio

Consul Load-Balancing made simple
https://fabiolb.net
MIT License
7.26k stars 616 forks source link

URLs breaking on Fabio load balanced websites with F5 BigIP #849

Open arunkchow opened 2 years ago

arunkchow commented 2 years ago

I have built a typical Hashi Nomad-Consul cluster stack with the below setup:

Nomad Client servers are thrown into BigIP F5 pool with service port as 9999 for making the Fabio load balanced services available externally. Configuration wise, everything works just fine for single endpoint micro services. However the the problem appears when theres multi-url links and pages within on a site or service deployed.

For example, if we wanted to host a simple promotional website which has links within to navigate it all falls apart. Here's an example stanza for service for Fabio to pickup:

  service {
    name = "promo-nov"
    port = "http"
    tags = [
      "urlprefix-/uberpromo/ strip=/uberpromo",
    ]
    check {
      type     = "http"
      port     = "http"
      path     = "/"
      interval = "2s"
      timeout  = "2s"
    }
  }

I can get to home page of the promo site if I use the the F5 VIP URL with '/uberpromo/' tag. However, if I click a link on the webpage, for example, 'Contact Us' on the home page which should ideally take me to https://f5-hosted-url.com/uberpromo/contactus.html it drops '/uberpromo/' and takes me to the url https://f5-hosted-url.com/contactus.html and throws page not found.

And if I use the url https://f5-hosted-url.com/uberpromo/contactus.html directly it works but if I click 'home' on the page it breaks again. Takes me to https://f5-hosted-url.com dropping '/uberpromo/'.

Is there a solution or way around this problem. Please suggest!

KTruesdellENA commented 2 years ago

In the service stanza have you tried removing the strip=/uberpromo ? Would that still work?