2007-11-29 14:43:32 +00:00
|
|
|
#
|
|
|
|
# demo config for Proxy mode
|
|
|
|
#
|
|
|
|
|
|
|
|
global
|
|
|
|
maxconn 20000
|
|
|
|
ulimit-n 16384
|
|
|
|
log 127.0.0.1 local0
|
|
|
|
uid 200
|
|
|
|
gid 200
|
|
|
|
chroot /var/empty
|
|
|
|
daemon
|
|
|
|
|
|
|
|
frontend test-proxy
|
|
|
|
bind 192.168.200.10:8080
|
|
|
|
mode http
|
|
|
|
log global
|
|
|
|
option httplog
|
|
|
|
option dontlognull
|
|
|
|
option nolinger
|
|
|
|
option http_proxy
|
|
|
|
maxconn 8000
|
2015-10-13 13:43:39 +00:00
|
|
|
timeout client 30s
|
2007-11-29 14:43:32 +00:00
|
|
|
|
|
|
|
# layer3: Valid users
|
|
|
|
acl allow_host src 192.168.200.150/32
|
2015-10-13 13:43:39 +00:00
|
|
|
http-request deny if !allow_host
|
2007-11-29 14:43:32 +00:00
|
|
|
|
|
|
|
# layer7: prevent private network relaying
|
|
|
|
acl forbidden_dst url_ip 192.168.0.0/24
|
|
|
|
acl forbidden_dst url_ip 172.16.0.0/12
|
|
|
|
acl forbidden_dst url_ip 10.0.0.0/8
|
2015-10-13 13:43:39 +00:00
|
|
|
http-request deny if forbidden_dst
|
2007-11-29 14:43:32 +00:00
|
|
|
|
|
|
|
default_backend test-proxy-srv
|
|
|
|
|
|
|
|
|
|
|
|
backend test-proxy-srv
|
|
|
|
mode http
|
2015-10-13 13:43:39 +00:00
|
|
|
timeout connect 5s
|
|
|
|
timeout server 5s
|
2007-11-29 14:43:32 +00:00
|
|
|
retries 2
|
|
|
|
option nolinger
|
|
|
|
option http_proxy
|
|
|
|
|
|
|
|
# layer7: Only GET method is valid
|
|
|
|
acl valid_method method GET
|
2015-10-13 13:43:39 +00:00
|
|
|
http-request deny if !valid_method
|
2007-11-29 14:43:32 +00:00
|
|
|
|
|
|
|
# layer7: protect bad reply
|
2015-10-13 13:43:39 +00:00
|
|
|
http-response deny if { res.hdr(content-type) audio/mp3 }
|