{"id":1967,"date":"2014-08-15T07:54:23","date_gmt":"2014-08-15T07:54:23","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1967"},"modified":"2014-08-15T07:54:23","modified_gmt":"2014-08-15T07:54:23","slug":"simple-tcp-proxy-with-haproxy","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1967","title":{"rendered":"Simple TCP Proxy with haproxy"},"content":{"rendered":"<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"text codecolorer\">#---------------------------------------------------------------------<br \/>\n# Example configuration for a possible web application. &nbsp;See the<br \/>\n# full configuration options online.<br \/>\n#<br \/>\n# &nbsp; http:\/\/haproxy.1wt.eu\/download\/1.4\/doc\/configuration.txt<br \/>\n#<br \/>\n#---------------------------------------------------------------------<br \/>\n<br \/>\n#---------------------------------------------------------------------<br \/>\n# Global settings<br \/>\n#---------------------------------------------------------------------<br \/>\nglobal<br \/>\n&nbsp; &nbsp; # to have these messages end up in \/var\/log\/haproxy.log you will<br \/>\n&nbsp; &nbsp; # need to:<br \/>\n&nbsp; &nbsp; #<br \/>\n&nbsp; &nbsp; # 1) configure syslog to accept network log events. &nbsp;This is done<br \/>\n&nbsp; &nbsp; # &nbsp; &nbsp;by adding the '-r' option to the SYSLOGD_OPTIONS in<br \/>\n&nbsp; &nbsp; # &nbsp; &nbsp;\/etc\/sysconfig\/syslog<br \/>\n&nbsp; &nbsp; #<br \/>\n&nbsp; &nbsp; # 2) configure local2 events to go to the \/var\/log\/haproxy.log<br \/>\n&nbsp; &nbsp; # &nbsp; file. A line like the following can be added to<br \/>\n&nbsp; &nbsp; # &nbsp; \/etc\/sysconfig\/syslog<br \/>\n&nbsp; &nbsp; #<br \/>\n&nbsp; &nbsp; # &nbsp; &nbsp;local2.* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/var\/log\/haproxy.log<br \/>\n&nbsp; &nbsp; #<br \/>\n&nbsp; &nbsp; log &nbsp; &nbsp; &nbsp; &nbsp; 127.0.0.1 local2<br \/>\n<br \/>\n&nbsp; &nbsp; chroot &nbsp; &nbsp; &nbsp;\/var\/lib\/haproxy<br \/>\n&nbsp; &nbsp; pidfile &nbsp; &nbsp; \/var\/run\/haproxy.pid<br \/>\n&nbsp; &nbsp; maxconn &nbsp; &nbsp; 4000<br \/>\n&nbsp; &nbsp; user &nbsp; &nbsp; &nbsp; &nbsp;haproxy<br \/>\n&nbsp; &nbsp; group &nbsp; &nbsp; &nbsp; haproxy<br \/>\n&nbsp; &nbsp; daemon<br \/>\n<br \/>\n&nbsp; &nbsp; # turn on stats unix socket<br \/>\n&nbsp; &nbsp; stats socket \/var\/lib\/haproxy\/stats<br \/>\n<br \/>\n#---------------------------------------------------------------------<br \/>\n# common defaults that all the 'listen' and 'backend' sections will<br \/>\n# use if not designated in their block<br \/>\n#---------------------------------------------------------------------<br \/>\ndefaults<br \/>\n&nbsp; &nbsp; timeout connect &nbsp; &nbsp; &nbsp; &nbsp; 5000ms<br \/>\n&nbsp; &nbsp; timeout client &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5000ms<br \/>\n&nbsp; &nbsp; timeout server &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5000ms<br \/>\n&nbsp; &nbsp; maxconn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 50000<br \/>\n<br \/>\nfrontend ldap_in<br \/>\n&nbsp; &nbsp; bind 192.168.230.130:80<br \/>\n&nbsp; &nbsp; mode tcp<br \/>\n&nbsp; &nbsp; maxconn 10000<br \/>\n&nbsp; &nbsp; default_backend ldap_out<br \/>\n<br \/>\nbackend ldap_out<br \/>\n&nbsp; &nbsp; mode tcp<br \/>\n&nbsp; &nbsp; server ad 10.150.2.154:389 maxconn 10000 check<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; # Example configuration for a possible web application. &nbsp;See the # full configuration options online. # # &nbsp; http:\/\/haproxy.1wt.eu\/download\/1.4\/doc\/configuration.txt # #&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1967","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1967"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1967\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}