[BACK]Return to hoststated.conf CVS log [TXT][DIR] Up to [local] / src / etc

File: [local] / src / etc / Attic / hoststated.conf (download)

Revision 1.4, Mon Feb 26 13:58:31 2007 UTC (17 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.3: +27 -1 lines

add an relay example

ok pyr@

# $OpenBSD: hoststated.conf,v 1.4 2007/02/26 13:58:31 reyk Exp $
#
# Macros
#
webhost1="10.0.0.1"
webhost2="10.0.0.2"

#
# Global Options
#
# interval 10
# timeout 200
# prefork 5

#
# Each table will be mapped to a pf table.
#
table webhosts {
	real port http
	check http "/" code 200
	host $webhost1
	host $webhost2
}

table fallback {
	real port http
	check icmp
	host 127.0.0.1
}

#
# Services will be mapped to a rdr rule.
#
service www {
	virtual host 192.168.1.1 port http interface trunk0

	# tag every packet that goes thru the rdr rule with HOSTSTATED
	tag HOSTSTATED

	table webhosts
	backup table fallback
}

#
# Relays and protocols are used for Layer 7 loadbalancing
#
protocol httpssl {
        protocol http
        append "$REMOTE_ADDR" to "X-Forwarded-For"
        append "$SERVER_ADDR:$SERVER_PORT" to "X-Forwarded-By"
	change "Connection" to "close"

        # Various TCP performance options
        tcp { nodelay, sack, socket buffer 65536, backlog 128 }

#	ssl { no sslv2, sslv3, tlsv1, ciphers HIGH }
#	ssl session cache disable
}

relay wwwssl {
	# Run as a SSL accelerator
	listen on 192.168.1.1 port 443 ssl
	protocol httpssl

	# Forward to hosts in the webhosts table using a src/dst hash
	table webhosts loadbalance
}