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

Combination of path_beg and hdr not working

$
0
0

@Linja wrote:

Hi,

I am trying to send requests to api.mydomain.com/some-service to another backend serving the actual some-service.
Since I’m hosting many different domains in haproxy, I need to make sure requests going to some-service arehaving api.mydomain.com on host header not anything else.

here is a sample of my configuration

frontend server
    bind *:443 ssl crt /etc/haproxy/ssl/cent.pem
    acl API hdr(Host) -i api.mydomain.com
    acl SERVICE path_beg -i /some-service 
    use_backend back_service if SERVICE API
    use_backend back_api if API 

backend back_service
  option forwardfor
    http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server service 172.16.1.62:80 check maxconn 1000

backend back_api
  option forwardfor
    http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server api 172.16.1.60:80 check maxconn 1000

the result with this config is all requests are going to bach_api.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4726

Trending Articles



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