{"id":308,"date":"2022-02-02T10:07:35","date_gmt":"2022-02-02T10:07:35","guid":{"rendered":"http:\/\/byomkesh.in\/wordpress\/?p=308"},"modified":"2022-02-02T10:07:37","modified_gmt":"2022-02-02T10:07:37","slug":"installation-of-reverse-proxy-haproxy","status":"publish","type":"post","link":"http:\/\/byomkesh.in\/wordpress\/installation-of-reverse-proxy-haproxy\/","title":{"rendered":"Installation of Reverse Proxy HAPROXY"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Generated dhparams.pem for haproxy moved to its directory linked it in the haproxy.cfg file<\/p>\n\n\n\n<p>Kept most global options in the cfg file.  Add lines for frontend and backend.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">frontend default\n   bind :80\n   http-request redirect scheme https unless { ssl_fc }\n   use_backend % [req.hdr(host),lower,map_dom(\/etc\/haproxy\/maps\/hosts.map,be_default)]\n\n   default_backend             acer2\n<\/pre>\n\n\n\n<p>create hosts.map file for each and every host, each line must have host name and backend name like<\/p>\n\n\n\n<p>acer2.nmlindia.org                    acer2<\/p>\n\n\n\n<p>for each altername port create a frontend like above just replace :80 with say :8080 and provide another map file for hosts handing this port<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    backend acer2\r\n        mode http\r\n        http-request redirect scheme https unless { ssl_fc }\r\n        server acer2 acer2.nmlindia.org:8888 check\r\n\r\n<\/code><\/pre>\n\n\n\n<p>the line <\/p>\n\n\n\n<p><em>http-request redirect scheme https unless { ssl_fc }<\/em><\/p>\n\n\n\n<p>controls the reirection in case the traffic is SSL<\/p>\n\n\n\n<p>if nonSSL site comment out in both default block and backend block<\/p>\n\n\n\n<p>the port 8888 indicates the port where the website is running<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>frontend https\r\n   bind *:443 ssl crt-list \/etc\/haproxy\/ssl\/private\/crt-list.txt   # crt \/etc\/haproxy\/ssl\/bdpc-ssl.pem\r\n   mode tcp\r\n   tcp-request inspect-delay 5s\r\n   tcp-request content accept if { req_ssl_hello_type 1 }\r\n   use_backend acer2 if { ssl_fc_sni acer2.nmlindia.org }\r\n<\/code><\/pre>\n\n\n\n<p>Provide certificate path and mode should be tcp for SSL port <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Generated dhparams.pem for haproxy moved to its directory linked it in the haproxy.cfg file Kept most global options in the cfg file. Add lines for frontend and backend. frontend default bind :80 http-request redirect scheme https unless { ssl_fc } use_backend % [req.hdr(host),lower,map_dom(\/etc\/haproxy\/maps\/hosts.map,be_default)] default_backend acer2 create hosts.map file for each and every host, each line &hellip; <a href=\"http:\/\/byomkesh.in\/wordpress\/installation-of-reverse-proxy-haproxy\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Installation of Reverse Proxy HAPROXY<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":1,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":309,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts\/308\/revisions\/309"}],"wp:attachment":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}