Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4731

Rewrite URL without modifying underlying functionality

$
0
0

@jared_t wrote:

Running into a bit of challenge with URL re-writes. I am trying to whitelabel some of our services…

Lets say we offer a service at portal.company.com

now we setup tenants within that environment and without any whitelablel they can login with the following portal.company.com/login/tenant1.

what i would like to do is just do a rewrite for portal.company.com to portal.tenant.com while still leaving the ability for other users to access portal.company.com

What i have so far is as follows:

   frontend https_443_frontend
   mode http
   bind *:443 ssl crt certlocation
   http-request set-header X-Forwarded-Port %[dst_port]
   http-request add-header X-Forwarded-Proto https if { ssl_fc }
   http-request replace-uri ^portal.company1.com.*) portal.tenant.com\1 if { hdr(host) -i portal.tenant.com }
   acl host_portal_443 hdr(host) -i portal.company1.com
   acl host_tenant_443 hdr(host) -i portal.tenant.com
   use_backend portalbackend if host_portal_443
   use_backend whitelabel if host_tenant_443

   backend whitelabel
   mode http
   # option httpclose
   # option forwardfor
    balance roundrobin
    cookie SERVERID insert indirect nocache
    server pool1.company.com x.x.x.x:443 ssl verify non check cooike s1
    server pool2.company.com x.x.x.x:443 ssl verify non check cooike s1

the above replace-uri - that actually does replace the url however the moment you interact with it it reverts back… so i can imagine i am missing some session handling and more than likely how its handling some of the headers.

any help would be greatly appreciated.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4731

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>