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

HAPROXY : Same host with different path

$
0
0

@mpande wrote:

Hello ,

I am using haproxy where my requirement is same host but different paths.

http://hostaaa/x/
http://hostaaa/y/

And I am using below settings in haproxy.cfg
*************************************************************************************************************8
frontend main *:80

acl url_x path_beg /x/
acl url_y path_beg /y/

use_backend x-backend if url_x
use_backend y-backend if url_y

#---------------------------------------------------------------------

static backend for serving up images, stylesheets and such

#---------------------------------------------------------------------
backend static
balance roundrobin
server static 127.0.0.1:4331 check

#---------------------------------------------------------------------

round robin balancing between the various backends

#---------------------------------------------------------------------
backend x-backend
reqrep ^([^\ ])\ /x(/.) \1\ \2
cookie SERVERID insert indirect nocache
server x_0 host1:80 check cookie x_0
server x_1 host2:80 check cookie x_1
server x_2 host1:80 check cookie x_2

backend y-backend
reqrep ^([^\ ])\ /y(/.) \1\ \2
cookie SERVERID insert indirect nocache
server y_server0 hostaaa:8080 check cookie y_server0


hostaaa is also part of backend y-backend.

Appreciate support!!

Thanks

Regards,
M

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



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