HAProxy

nguyennamdsn | May 7, 2022, 6:54 p.m.

apache 2.2 - Hosting multiple domains on seperate servers but only one public IP address - Server Fault


HowTo: Add a new trusted domain - 📑 How to - Nextcloud community

How to add a new trusted domain to Nextcloud | TechRepublic

/var/snap/nextcloud/current/nextcloud/config/config.php

  'trusted_domains' => 

  array (

          0 => 'nguyennamdsn.ydns.eu',

          1 => 'cloud.nguyennamdsn.ydns.eu'

  ),

(1) Linux | Cấu hình HAproxy cân bằng tải cho 2 web server. - YouTube

# create new

global

    # for logging section

    log              127.0.0.1 local2 info

    chroot           /var/lib/haproxy

    pidfile          /var/run/haproxy.pid

    # max per-process number of connections

    maxconn          256

    # process user and group

    user             haproxy

    group            haproxy

    # make the process fork into background

    daemon

    nbproc           1

    #stats socket     /var/run/proxy.cmd mode 777 level admin


defaults

    # running mode

    mode             http

    # use global settings 

    log              global

    # get http requests log

    option           httplog

    # timeout if backends do not reply

    timeout connect  10s

    # timeout on client side

    timeout client   30s

    # timeout on server side

    timeout server   30s

    # retry time

    retries          3

    option           dontlognull


# define frontend ( set any name for "http-in" section )

frontend http-in

    # listion 80

    bind *:80

   

    acl req_blog       hdr_beg(host)   -i blog.    # blog.nguyennamdsn.ydns.eu

    acl req_gitlab     hdr_beg(host)   -i gitlab.  # gitlab.nguyennamdsn.ydns.eu

    acl req_cloud      hdr_beg(host)   -i cloud.   # cloud.nguyennamdsn.ydns.eu


    use_backend        blog            if req_blog

    use_backend        gitlab          if req_gitlab

    use_backend        cloud           if req_cloud 


    # set default backend

    default_backend  blog 

    # send X-Forward-For header

    option           forwardfor

    # 


# statistics page

frontend stats

    bind *:PORT

    stats enable

    stats refresh 10s

    stats admin if LOCALHOST

    mode http

    stats auth    user_name:password

    stats uri     /proxy_stats_uri

    stats realm   PAGE_TITLE

    stats show-node

    stats hide-version


# define backend

backend blog

    # balance with roundrobin

    balance          roundrobin

    # define backend servers

    server           blog      INTERNAL_IP1:INTERNAL_PORT1 check

    option           redispatch

    option           httpclose

    option           forwardfor

    timeout server   60s


backend gitlab  

    server           gitlab    INTERNAL_IP2:INTERNAL_PORT2 weight 1 maxconn 256 check inter 1000

    option           redispatch

    option           httpclose

    option           forwardfor

    balance          roundrobin

    timeout server   60s


backend cloud

    server           cloud     INTERNAL_IP3:INTERNAL_PORT3 weight 1 maxconn 256 check inter 1000

    option           redispatch

    option           httpclose

    option           forwardfor

    balance          roundrobin

    timeout server   60s




0
0

Leave a comment:

Comments: