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

Configure virtualhost on haproxy

$
0
0

@newbie91 wrote:

hallo, can someone help me? I have problem with multiple website that I hosted on my backend server, I have 2 backend server as follow :

  1. server1.local 192.168.10.100
  2. server2.local 192.168.11.100

and my haproxy server is : server3.local 192.168.12.10

my dirrectory web I put it on both backend server :

  1. server1 /var/www/html/nextcloud
  2. server2 /var/www/html/nextcloud

I wanto configure load balancing and HA in HAProxy server, but not working, my haproxy.cfg is as follow :

frontend LB
bind *:80
reqadd X-Forwarded-Proto:\ http
#default_backend LB

Define hosts

acl host_cacti hdr(host) -i dakusoft.cacti
acl host_osticket hdr(host) -i dakusoft.osticket
acl host_nextcloud hdr(host) -i dakusoft.nextcloud

figure out which one to use

use_backend cacti_cluster if host_cacti
use_backend osticket_cluster if host_osticket
use_backend nextcloud_cluster if host_nextcloud

backend cacti_cluster
balance leastconn
option httpclose
rspadd X-Frame-Options:\ SAMEORIGIN
option forwardfor
cookie JSESSIONID prefix
server server1 server1.local:80 cookie server1 check
#server server2 server2.local:80 cookie server2 check

backend nextcloud_cluster
balance leastconn
rspadd X-Frame-Options:\ SAMEORIGIN
option httpclose
option forwardfor
cookie JSESSIONID prefix
server server1 server1.local:80 cookie server1 check
server server2 server2.local:80 cookie server2 check

and this is virtualhost configuration on backend that I created on both of backend server

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>