CONTENT
  • CHANGES
Szukaj
counter

#top Nginx behind HAProxy


Zobacz także Nginx behind HAProxy dla: Nginx (Nginx)

W niniejszej konfiguracji HAProxy odbiera połączenia przychodzące na port 80 i przekierowywuje je do Nginx na port 85:

# main frontend which proxys to the backends
frontend public_http
	bind        :::80
	# Enable insertion of the X-Forwarded-For header to requests sent to servers
	option  forwardfor except 127.0.0.0/8
	
	acl requ_www         path_beg      -i /www
	acl ah_cen06x64      hdr(host)     -i cen06x64.xen.wbcd.pl
	
	use_backend   bknd_cen06x64_nginx if ah_cen06x64 !requ_www
	use_backend   bknd_cen06x64_nginx if ah_cen06x64  requ_www
	
	default_backend      bknd_cen06x64_nginx

# The default backend for nginx
backend bknd_cen06x64_nginx
	stats enable
	stats uri     /admin?stats
	stats realm   Haproxy\ Statistics
	stats auth    *****:*****
	stats refresh 5s
	# Define the load balancing algorithm to be used in a backend
	balance     roundrobin
	# Enable HTTP protocol to check on the servers health
	# By default, server health checks only consist in trying to establish a TCP connection
	# When "option httpchk" is specified, a complete HTTP request is sent
	# once the TCP connection is established, and responses 2xx and 3xx are considered valid,
	# while all other ones indicate a server failure, including the lack of any response
	#option      httpchk HEAD /globals.php
	#cookie      DYNSRV insert indirect nocache
	server      host_cen06x64_nginx 10.41.0.58:85
	#check inter 25000



#top Lighttpd behind HAProxy


Zobacz także Lighttpd behind HAProxy dla: Lighttpd (Lighttpd)

W niniejszej konfiguracji HAProxy odbiera połączenia przychodzące na port 80 i przekierowywuje je do Lighttpd na port 86:

# main frontend which proxys to the backends
frontend public_http
	bind        :::80
	# Enable insertion of the X-Forwarded-For header to requests sent to servers
	option  forwardfor except 127.0.0.0/8
	
	acl requ_www         path_beg      -i /www
	acl ah_cen06x64      hdr(host)     -i cen06x64.xen.wbcd.pl
	
	use_backend   bknd_cen06x64_lighttpd if ah_cen06x64 !requ_www
	use_backend   bknd_cen06x64_lighttpd if ah_cen06x64  requ_www
	
	default_backend      bknd_cen06x64_lighttpd

# The default backend for lighttpd
backend bknd_cen06x64_lighttpd
	stats enable
	stats uri     /admin?stats
	stats realm   Haproxy\ Statistics
	stats auth    *****:*****
	stats refresh 5s
	# Define the load balancing algorithm to be used in a backend
	balance     roundrobin
	# Enable HTTP protocol to check on the servers health
	# By default, server health checks only consist in trying to establish a TCP connection
	# When "option httpchk" is specified, a complete HTTP request is sent
	# once the TCP connection is established, and responses 2xx and 3xx are considered valid,
	# while all other ones indicate a server failure, including the lack of any response
	#option      httpchk HEAD /globals.php
	#cookie      DYNSRV insert indirect nocache
	server      host_cen06x64_lighttpd 10.41.0.58:86
	#check inter 25000



#top Varnish behind HAProxy


Zobacz także Varnish behind HAProxy dla: Varnish (Varnish)

W niniejszej konfiguracji HAProxy odbiera połączenia przychodzące na port 80 i przekierowywuje je do Varnish na port 87:

# main frontend which proxys to the backends
frontend public_http
	bind        :::80
	# Enable insertion of the X-Forwarded-For header to requests sent to servers
	option  forwardfor except 127.0.0.0/8
	
	acl requ_www         path_beg      -i /www
	acl ah_cen06x64      hdr(host)     -i cen06x64.xen.wbcd.pl
	
	use_backend   bknd_cen06x64_varnish if ah_cen06x64 !requ_www
	use_backend   bknd_cen06x64_varnish if ah_cen06x64  requ_www
	
	default_backend      bknd_cen06x64_varnish

# The default backend for lighttpd
backend bknd_cen06x64_varnish
	stats enable
	stats uri     /admin?stats
	stats realm   Haproxy\ Statistics
	stats auth    *****:*****
	stats refresh 5s
	# Define the load balancing algorithm to be used in a backend
	balance     roundrobin
	# Enable HTTP protocol to check on the servers health
	# By default, server health checks only consist in trying to establish a TCP connection
	# When "option httpchk" is specified, a complete HTTP request is sent
	# once the TCP connection is established, and responses 2xx and 3xx are considered valid,
	# while all other ones indicate a server failure, including the lack of any response
	#option      httpchk HEAD /globals.php
	#cookie      DYNSRV insert indirect nocache
	server      host_cen06x64_varnish 10.41.0.58:87
	#check inter 25000



#top Dovecot behind HAProxy


Zobacz także Dovecot behind HAProxy dla: Dovecot (Dovecot)

W niniejszej konfiguracji HAProxy odbiera połączenia przychodzące na port 1143 i przekierowywuje je do Dovecot na port 10143:
Dla porównania konfiguracji HAProxy odbiera połączenia przychodzące na port 1243 i przekierowywuje je do Dovecot na standardowy port 143:

frontend public_imap
    bind    :::1143
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Enable logging of HTTP request, session state and timers
    option  tcplog
    default_backend bknd_cen060x64_imap

backend bknd_cen060x64_imap
    # Enable the statistics page
    stats enable
    stats uri /admin?stats
    stats realm Haproxy\ Statistics
    stats auth *****:*****
    stats refresh 5s
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Define the load balancing algorithm to be used in a backend
    balance leastconn
    retries 1
    stick           store-request src
    stick-table     type ip size 200k expire 30m
    server  host_cen060x64 10.41.0.58:10143 send-proxy-v2

[...]

frontend public_imap2
    bind    :::1243
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Enable logging of HTTP request, session state and timers
    option  tcplog
    default_backend bknd_cen060x64_imap2

backend bknd_cen060x64_imap2
    # Enable the statistics page
    stats enable
    stats uri /admin?stats
    stats realm Haproxy\ Statistics
    stats auth *****:*****
    stats refresh 5s
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Define the load balancing algorithm to be used in a backend
    balance leastconn
    retries 1
    stick           store-request src
    stick-table     type ip size 200k expire 30m
    server  host_cen060x64 10.41.0.58:143 no-send-proxy no-send-proxy-v2



#top Postfix behind HAProxy


Zobacz także Postfix behind HAProxy dla: Postfix (Postfix)

W niniejszej konfiguracji HAProxy odbiera połączenia przychodzące na port 1025 i przekierowywuje je do Postfix na port 20026:
Dla porównania konfiguracji HAProxy odbiera połączenia przychodzące na port 1125 i przekierowywuje je do Postfix na standardowy port 25:

frontend public_smtp
    bind    :::1025
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Enable logging of HTTP request, session state and timers
    option  tcplog
    default_backend bknd_cen060x64_smtp

backend bknd_cen060x64_smtp
    # Enable the statistics page
    stats enable
    stats uri /admin?stats
    stats realm Haproxy\ Statistics
    stats auth *****:*****
    stats refresh 5s
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Define the load balancing algorithm to be used in a backend
    balance leastconn
    retries 1
    stick           store-request src
    stick-table     type ip size 200k expire 30m
    server  host_cen060x64 10.41.0.58:20026 send-proxy

[...]

frontend public_smtp2
    bind    :::1125
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Enable logging of HTTP request, session state and timers
    option  tcplog
    default_backend bknd_cen060x64_smtp2

backend bknd_cen060x64_smtp2
    # Enable the statistics page
    stats enable
    stats uri /admin?stats
    stats realm Haproxy\ Statistics
    stats auth *****:*****
    stats refresh 5s
    # Set the running mode or protocol of the instance
    # tcp    - The instance will work in pure TCP mode.
    # http   - The instance will work in HTTP mode.
    # health - The instance will work in "health" mode. It will just reply "OK" to incoming connections and close the conne
    mode    tcp
    # Define the load balancing algorithm to be used in a backend
    balance leastconn
    retries 1
    stick           store-request src
    stick-table     type ip size 200k expire 30m
    server  host_cen060x64 10.41.0.58:25 no-send-proxy no-send-proxy-v2




Zmodyfikowany ostatnio: 2018/04/11 23:28:36 (7 lat temu), textsize: 81,4 kB, htmlsize: 14,4 kB

Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników