{"id":469296,"date":"2025-08-01T09:00:30","date_gmt":"2025-08-01T09:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=469296"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=469296","title":{"rendered":"<span>\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 Exchange Server 2019 \u0438 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u043c IP<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2><\/h2>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<strong> <\/strong>\u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u0415\u0436\u043a\u043e\u0432 \u0438\u0437<strong> <\/strong>\u0438\u0437 Cloud4Y. \u041e\u0434\u0438\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IPv4, \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Exchange \u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u2014 \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043a\u0430? \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a\u00a0\u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0435\u0451, \u0437\u0430\u0432\u0435\u0434\u044f \u0432\u0441\u0451 \u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u043e \u0437\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c IP \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443.   <\/p>\n<div class=\"floating-image\">\n<figure class=\"float bordered full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8af\/e56\/f41\/8afe56f4182518eb43bdc2a9654a4f7f.png\" width=\"780\" height=\"440\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/8af\/e56\/f41\/8afe56f4182518eb43bdc2a9654a4f7f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8af\/e56\/f41\/8afe56f4182518eb43bdc2a9654a4f7f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0424\u0438\u0440\u043c\u0430\u0447\u043a\u0430\u00bb (\u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u2014 <a href=\"http:\/\/firmachka.pro\" rel=\"noopener noreferrer nofollow\">firmachka.pro<\/a>) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Exchange Server 2019 \u043f\u0435\u0440\u0435\u0432\u0430\u043b\u0438\u043b\u043e \u0437\u0430 \u0441\u043e\u0442\u043d\u044e, \u0430 \u0442\u0440\u0430\u0444\u0438\u043a \u043a \u0434\u0432\u0443\u043c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430\u043c \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0432\u044b\u0440\u043e\u0441 \u043f\u043e\u0441\u043b\u0435 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u0438. \u0423 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IPv4.<\/p>\n<\/div>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<ol>\n<li>\n<p>\u041e\u0434\u0438\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IP-\u0430\u0434\u0440\u0435\u0441.<\/p>\n<\/li>\n<li>\n<p>SNI-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 DNS-\u0438\u043c\u0451\u043d.<\/p>\n<\/li>\n<li>\n<p>SSL-offload (TLS 1.2 \/ 1.3).<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 DoS, health-checks, \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u0434\u043b\u044f DAG-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Exchange \u0438 \u0434\u0432\u0443\u0445 \u0432\u0435\u0431-\u0443\u0437\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>DNS-\u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0441\u0430\u043c\u0430 DAG-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u00a0<strong>\u043d\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u044e\u0442\u0441\u044f<\/strong>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 DNS-\u0437\u0430\u043f\u0438\u0441\u0438 (A-\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f mail, autodiscover, portal, lb) \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 HAProxy.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0440\u0442\u044b 25, 80, 443 \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u043d\u0430 \u0444\u0430\u0439\u0440\u0432\u043e\u043b\u0435 \u0434\u043e HAProxy.<\/p>\n<\/li>\n<li>\n<p>Exchange DAG \u0438 \u0432\u0435\u0431-\u043f\u043e\u0440\u0442\u0430\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c sudo-\u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 HAProxy.<\/p>\n<\/li>\n<\/ul>\n<h3>2. \u0422\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h3>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/52e\/c0d\/0e0\/52ec0d0e04d7405750911eee0e12385e.png\" width=\"1133\" height=\"588\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/52e\/c0d\/0e0\/52ec0d0e04d7405750911eee0e12385e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/52e\/c0d\/0e0\/52ec0d0e04d7405750911eee0e12385e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u2022 HAProxy \u2265 2.4 \u0438\u0437 backports\/debian-bookworm.<br \/>\u2022 Exchange Server 2019 CU13 (\u0434\u0432\u0435 \u043d\u043e\u0434\u044b DAG).<br \/>\u2022 \u041f\u043e\u0440\u0442\u0430\u043b \u043d\u0430 IIS 10 \/ <a href=\"http:\/\/ASP.NET\" rel=\"noopener noreferrer nofollow\">ASP.NET<\/a> Core.<\/p>\n<h3>3. \u041e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b *.pem \u0432 \/etc\/ssl\/private<\/h3>\n<h4>3.1. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442<\/h4>\n<p>\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0443\u0436\u0435\u043d \u043e\u0434\u0438\u043d \u2014\u00a0<code>*.<\/code><a href=\"http:\/\/firmachka.pro\" rel=\"noopener noreferrer nofollow\"><code>firmachka.pro<\/code><\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c\u00a0<code>mail<\/code>,\u00a0<code>autodiscover<\/code>,\u00a0<code>portal<\/code>,\u00a0<code>lb<\/code>\u00a0\u0438 \u043b\u044e\u0431\u044b\u0435 \u0431\u0443\u0434\u0443\u0449\u0438\u0435 \u0438\u043c\u0435\u043d\u0430.<\/p>\n<p>ACME-\u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u0442 wildcard \u0447\u0435\u0440\u0435\u0437 DNS-01-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">DOMAIN=\"firmachka.pro\" CERT_DIR=\"\/etc\/ssl\/private\"  certbot certonly \\         --agree-tos \\         --manual \\         --preferred-challenges dns \\         -d \"*.${DOMAIN}\" -d \"${DOMAIN}\" \\         --manual-public-ip-logging-ok  # \u0441\u043a\u043b\u0435\u0439\u043a\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 HAProxy cat \/etc\/letsencrypt\/live\/${DOMAIN}\/privkey.pem \\     \/etc\/letsencrypt\/live\/${DOMAIN}\/fullchain.pem \\     &gt; ${CERT_DIR}\/wildcard.${DOMAIN}.pem chmod 600 ${CERT_DIR}\/wildcard.${DOMAIN}.pem <\/code><\/pre>\n<blockquote>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 DNS-01 \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f DNS-\u043f\u043b\u0430\u0433\u0438\u043d\u044b Certbot<\/p>\n<\/blockquote>\n<h4>3.2. DH-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h4>\n<pre><code class=\"bash\">openssl dhparam -out \/etc\/haproxy\/certs\/dhparam.pem 2048 <\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439\u00a0<code>ssl-dh-param-file<\/code>. \u0411\u0435\u0437 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 DH-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u00abweak prime reuse\u00bb.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435\u00a0<code>systemctl reload haproxy<\/code>, \u0438\u043d\u0430\u0447\u0435 HAProxy \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443<\/p>\n<\/blockquote>\n<h3>4. \u041f\u043e\u043b\u043d\u044b\u0439 haproxy.cfg<\/h3>\n<h4>4.1. global<\/h4>\n<pre><code>global     log \/dev\/log    local0 notice     stats socket \/run\/haproxy\/admin.sock mode 660 level admin expose-fd listeners     stats timeout 30s     user haproxy     group haproxy     daemon      maxconn 20000      ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets prefer-client-ciphers     ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384     ssl-default-bind-ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384      ssl-dh-param-file \/etc\/haproxy\/certs\/dhparam.pem     tune.ssl.default-dh-param 2048 <\/code><\/pre>\n<p>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><code>log \/dev\/log local0 notice<\/code>\u00a0\u2014 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u0443\u0435\u043c \u0432 rsyslog; \u0443\u0440\u043e\u0432\u0435\u043d\u044c notice \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0434\u0438\u0441\u043a.<\/p>\n<\/li>\n<li>\n<p><code>stats socket<\/code>\u00a0\u2014 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f Runtime API \u0438 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><code>maxconn 20000<\/code>\u00a0\u2014 \u043b\u0438\u043c\u0438\u0442 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438: \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 50 \u041a\u0411\/conn \u21d2 \u22481 \u0413\u0411 RSS.<\/p>\n<\/li>\n<li>\n<p><code>ssl-default-bind-options<\/code>\u00a0\u2014 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c TLS 1.0\/1.1, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c session tickets (\u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0430\u0442\u0430\u043a resumption-tracking), \u043d\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0430\u0448 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0448\u0438\u0444\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><code>ssl-default-bind-ciphersuites<\/code>\u00a0\u2014 suite-\u044b \u0434\u043b\u044f TLS 1.3.<\/p>\n<\/li>\n<li>\n<p><code>tune.ssl.default-dh-param<\/code>\u00a0\u2014 fallback-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438\u00a0<code>ssl-dh-param-file<\/code>\u00a0\u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0427\u0430\u0441\u0442\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u2014 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00a0<code>ssl-default-bind-options<\/code>\u00a0\u0431\u0435\u0437\u00a0<code>prefer-client-ciphers<\/code>; \u0442\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u0440\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0432\u044b\u0431\u0435\u0440\u0443\u0442 RC4.<\/p>\n<\/blockquote>\n<h4>4.2. defaults<\/h4>\n<pre><code>defaults     mode    http     log     global     option  httplog     option  dontlognull     option  forwardfor     option  redispatch     option  http-server-close     retries 3          http-request set-header X-Forwarded-Proto https if { ssl_fc }      timeout connect 10s     timeout client  300s     timeout server  300s     errorfile 403 \/etc\/haproxy\/errors\/403.http     errorfile 503 \/etc\/haproxy\/errors\/503.http <\/code><\/pre>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><code>option http-server-close<\/code>\u00a0\u2014 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 keep-alive, \u0430 \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430; \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u043d\u0430 TIME_WAIT.<\/p>\n<\/li>\n<li>\n<p><code>forwardfor<\/code>\u00a0+\u00a0<code>set-header X-Forwarded-Proto<\/code>\u00a0\u2014 OWA \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u0438\u0434\u0430 https:\/\/.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0439\u043c\u0430\u0443\u0442\u044b 300 s \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d\u044b \u043f\u043e\u0434 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 OWA.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0417\u0430\u0431\u044b\u0442\u044b\u0439\u00a0<code>option httpclose<\/code>\u00a0\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0431\u0440\u044b\u0432\u0443 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u0447\u0435\u0440\u0435\u0437 OWA\/OWA Light.<\/p>\n<\/blockquote>\n<h4>4.3. frontend ft_http \u2014 \u043f\u043e\u0440\u0442 80<\/h4>\n<pre><code>frontend ft_http     bind *:80     mode http      acl host_portal hdr(host) -i portal.firmachka.pro     use_backend be_portal if host_portal      redirect scheme https code 301 if !host_portal <\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0440\u0442\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438 \u043f\u043e HTTP :80 (SEO-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 HTTPS (301).<\/p>\n<\/li>\n<\/ol>\n<h4>4.4. frontend ft_https \u2014 \u043f\u043e\u0440\u0442 443<\/h4>\n<pre><code>frontend ft_https     bind *:443 ssl crt \/etc\/ssl\/private\/wildcard.firmachka.pro.pem     mode http      http-response set-header X-Frame-Options SAMEORIGIN     http-response set-header X-Content-Type-Options nosniff     http-response set-header Strict-Transport-Security \"max-age=63072000; includeSubDomains\"      # \u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 DoS     stick-table type ip size 200k expire 30s store http_req_rate(10s)     http-request track-sc0 src     http-request deny status 429 if { sc_http_req_rate(0) gt 100 }      # ---------- ACL ----------     acl host_portal        hdr(host) -i portal.firmachka.pro     acl host_autodiscover  hdr(host) -i autodiscover.firmachka.pro      acl url_ecp path_beg -i \/ecp      # !!! \u0412\u0410\u0416\u041d\u041e: \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0435\u0442\u044c !!!     acl admin_network src 192.168.20.0\/24     http-request deny if url_ecp !admin_network      # ---------- \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f ----------     use_backend be_portal_https      if host_portal     use_backend be_exchange_unified  if host_autodiscover      default_backend be_exchange_unified <\/code><\/pre>\n<p>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041e\u0434\u0438\u043d wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/autodiscover.firmachka.pro\" rel=\"noopener noreferrer nofollow\"><code>autodiscover.firmachka.pro<\/code><\/a>\u00a0\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u0442 \u0436\u0435 backend, \u0447\u0442\u043e \u0438\u00a0<code>mail<\/code>.<\/p>\n<\/li>\n<li>\n<p>Security-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0443\u0431\u0438\u0440\u0430\u044e\u0442 mixed-content \u0438 click-jacking.<\/p>\n<\/li>\n<li>\n<p><code>stick-table<\/code>\u00a0\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 &gt; 100 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\/10 s \u21d2 HTTP 429 Too Many Requests.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 ECP: \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438. Exchange \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u2022 \u0422\u0430\u0431\u043b\u0438\u0446\u0430 200 k \u043d\u0430 30 s \u2248 14 MB RAM. \u0421\u0442\u0430\u0442\u0443\u0441 \u0432 Runtime API:\u00a0<code>show table ft_https<\/code>.<br \/>\u2022 \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d IPv6, \u0437\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e stick-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 type ipv6.<\/p>\n<\/blockquote>\n<h4>4.5. frontend ft_smtp \u2014 \u043f\u043e\u0440\u0442 25<\/h4>\n<pre><code>frontend ft_smtp     bind *:25     mode tcp          # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439     stick-table type ip size 50k expire 1m store conn_rate(10s)     tcp-request connection track-sc0 src     tcp-request connection reject if { sc_conn_rate(0) gt 10 }          default_backend be_smtp <\/code><\/pre>\n<ul>\n<li>\n<p>Layer 4 proxy, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 STARTTLS-offload; Exchange \u0441\u0430\u043c \u043e\u0442\u0434\u0430\u0451\u0442 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442.<\/p>\n<\/li>\n<li>\n<p>10 conns \/ 10 s \u2192 reject (\u0431\u043e\u0440\u044c\u0431\u0430 \u0441 \u0431\u043e\u0442\u043d\u0435\u0442\u0430\u043c\u0438, \u043d\u0435 \u0432\u043b\u0438\u044f\u044f \u043d\u0430 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u0439 MX-\u0442\u0440\u0430\u0444\u0438\u043a).<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0421\u0435\u0440\u044b\u0435 \u043b\u0438\u0441\u0442\u044b (greylisting) \u043b\u044e\u0431\u044f\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f. \u041f\u043e\u0434\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u0438\u043c\u0438\u0442 \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u043f\u043e\u0447\u0442\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/blockquote>\n<h4>4.6. backend be_portal<\/h4>\n<pre><code>backend be_portal     mode http     balance roundrobin     option httpchk GET \/     http-check expect status 200     server portal01 192.168.20.10:80  check inter 3s rise 2 fall 3     server portal02 192.168.20.11:80  check inter 3s rise 2 fall 3 <\/code><\/pre>\n<ul>\n<li>\n<p><code>rise 2 \/ fall 3<\/code>\u00a0\u2014 \u0443\u0437\u0435\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u0437\u0434\u043e\u0440\u043e\u0432\u044b\u043c\u00bb \u043f\u043e\u0441\u043b\u0435 \u0434\u0432\u0443\u0445 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0447\u0435\u043a\u043e\u0432 \u0438 \u00ab\u0431\u043e\u043b\u044c\u043d\u044b\u043c\u00bb \u043f\u043e\u0441\u043b\u0435 \u0442\u0440\u0451\u0445 \u043d\u0435\u0443\u0434\u0430\u0447.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0445\u0435\u043c\u0430 round-robin \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442: \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 Redis-\u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u043d\u0435\u0442 state-stickiness.<\/p>\n<\/li>\n<\/ul>\n<h4>4.7. backend be_portal_https<\/h4>\n<pre><code>backend be_portal_https     mode http     balance roundrobin     option httpchk GET \/     http-check expect status 200     server portal01 192.168.20.10:443 ssl verify none check inter 3s rise 2 fall 3     server portal02 192.168.20.11:443 ssl verify none check inter 3s rise 2 fall 3 <\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0442\u0430\u043a\u0436\u0435 \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f;\u00a0<code>verify none<\/code>\u00a0\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f VLAN.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 internal-CA, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430\u00a0<code>verify required ca-file \/etc\/ssl\/certs\/ca_portal.pem<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h4>4.8. backend be_exchange_unified<\/h4>\n<pre><code>backend be_exchange_unified     mode http     balance source     option httpchk GET \/owa\/healthcheck.htm     http-check expect status 200     server ex01 192.168.0.100:443 ssl verify none check inter 3s rise 2 fall 3     server ex02 192.168.0.101:443 ssl verify none check inter 3s rise 2 fall 3 <\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443\u00a0<code>balance source<\/code>?<\/p>\n<p>Exchange \u043a\u043b\u0435\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044e OWA \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443\u00a0<code>ClientAccessServer<\/code>. Sticky-cookie \u0442\u043e\u0436\u0435 \u0440\u0435\u0448\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u043e source-hash \u043f\u0440\u043e\u0449\u0435 \u0438 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 ActiveSync \u0441 legacy-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<p><code>healthcheck.htm<\/code>\u00a0\u2014 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 endpoint; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u00ab200 OK Healthy\u00bb \u0431\u0435\u0437 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u041f\u043e\u0441\u043b\u0435 CU-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f Microsoft \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441 \u00abHealthy\u00bb \u043d\u0430 \u00abOK\u00bb. \u041b\u043e\u0432\u0438\u0442\u0435 503? \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u00a0<code>curl -k<\/code>.<\/p>\n<\/blockquote>\n<h4>4.10. backend be_smtp<\/h4>\n<pre><code>backend be_smtp     mode tcp     balance roundrobin     option smtpchk EHLO firmachka.pro     server ex01 192.168.0.100:25 check     server ex02 192.168.0.101:25 check <\/code><\/pre>\n<p><code>option smtpchk<\/code>\u00a0\u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 EHLO \u0438 \u0436\u0434\u0451\u0442 \u043a\u043e\u0434\u0430 250. \u042d\u0442\u043e \u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0440\u0442 25 \u0432 \u00abgreen\u00bb \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u043c \u043f\u0430\u0434\u0435\u043d\u0438\u0438 Exchange.<\/p>\n<h4>4.11. listen stats<\/h4>\n<pre><code>listen stats     bind *:8404     stats enable     stats uri \/stats     stats realm \"HAProxy Statistics\"     stats auth admin:ChangeMeNow!     stats refresh 30s <\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u0435\u0431-\u043f\u0430\u043d\u0435\u043b\u044c \u043f\u043e HTTP (\u043d\u0435 HTTPS). \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u044c\u0442\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0444\u0430\u0439\u0440\u0432\u043e\u043b\u043e\u043c!<\/p>\n<\/li>\n<li>\n<p><code>stats socket<\/code>\u00a0\u0438\u0437 \u0431\u043b\u043e\u043a\u0430 global \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0435\u0431-GUI \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f\u00a0<code>socat \/run\/haproxy\/admin.sock -<\/code>\u00a0\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432 Prometheus-exporter.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h3>5. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n<ol>\n<li>\n<p>TLS 1.3 + \u0441\u0442\u0440\u043e\u0433\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0448\u0438\u0444\u0440\u043e\u0432, SessionTickets \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0434\u0438\u043d wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>stick-table \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 100 req\/10 s \u0438\u043b\u0438 10 conn\/10 s \u043d\u0430 SMTP.<\/p>\n<\/li>\n<li>\n<p><code>maxconn 20000<\/code>\u00a0+ Linux 5.10 (SO_REUSEPORT) \u0434\u0430\u044e\u0442 5\u20136 \u0413\u0431\u0438\u0442\/\u0441 \u0431\u0435\u0437 CPU-\u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442. \u041e\u043f\u0446\u0438\u044f SO_REUSEPORT \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 HAProxy \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0434\u0435\u0440 CPU, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 (worker processes) HAProxy, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>Health-checks \u0440\u0430\u0437 \u0432 3 s \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 SLA \u2265 99.9 % \u0431\u0435\u0437 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0448\u0443\u043c\u0430.<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<h3>6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<pre><code class=\"bash\">haproxy -c -f \/etc\/haproxy\/haproxy.cfg          # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 curl -k https:\/\/lb.firmachka.pro\/owa\/healthcheck.htm  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c Health Check \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b Exchange OWA curl -k https:\/\/autodiscover.firmachka.pro\/autodiscover\/autodiscover.xml -H \"Content-Type:text\/xml\"  # \u0418\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0441\u043b\u0443\u0436\u0431\u0435 Autodiscover Exchange \u0447\u0435\u0440\u0435\u0437 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a swaks --to recipient@example.com --from sender@firmachka.pro --server mail.firmachka.pro --port 25 -ehlo test  # \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b SMTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 openssl s_client -connect lb.firmachka.pro:443 -servername portal.firmachka.pro \\    # \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 TLS \u0438 \u043d\u0430\u0431\u043e\u0440\u0435 \u0448\u0438\u0444\u0440\u043e\u0432         -tlsextdebug -status | grep -E 'Selected|TLSv' <\/code><\/pre>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0415\u0441\u043b\u0438\u00a0<code>openssl<\/code>\u00a0\u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442\u00a0<code>New, TLSv1.2<\/code>, \u0430 \u043d\u0435\u00a0<code>TLSv1.3<\/code>, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e OpenSSL \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435.<\/p>\n<\/blockquote>\n<h3>7. \u042d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044f<\/h3>\n<ul>\n<li>\n<p>\u0413\u043e\u0440\u044f\u0447\u0438\u0439 reload:\u00a0<code>haproxy -f \/etc\/haproxy\/haproxy.cfg -c &amp;&amp; systemctl reload haproxy<\/code>.<\/p>\n<\/li>\n<li>\n<p>Runtime-API:\u00a0<code>echo \"show table ft_https\" | socat stdio \/run\/haproxy\/admin.sock<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433:\u00a0<code>github.com\/prometheus\/haproxy_exporter<\/code>\u00a0\u0447\u0438\u0442\u0430\u0435\u0442\u00a0<code>stats socket<\/code>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h3>8. \u0427\u0430\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u0438\u043c\u043f\u0442\u043e\u043c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0440\u0438\u0447\u0438\u043d\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">503 \u043d\u0430 OWA \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f wildcard-\u0441\u0435\u0440\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0437\u0430\u0431\u044b\u043b\u0438\u00a0<code>reload<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>systemctl reload haproxy<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">401\/403 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432 \/ecp<\/p>\n<\/td>\n<td>\n<p align=\"left\">ACL\u00a0<code>admin_network<\/code>\u00a0\u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043d\u043e\u0432\u043e\u0439 VPN-\u043f\u043e\u0434\u0441\u0435\u0442\u044c\u044e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c CIDR<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u0435\u0440\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a SMTP \u0440\u0435\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0443<\/p>\n<\/td>\n<td>\n<p align=\"left\">stick-table \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0442\u0440\u043e\u0433<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 conn_rate<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr\/>\n<h3>9. \u0418\u0442\u043e\u0433<\/h3>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438:<\/p>\n<ul>\n<li>\n<p>Wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u00a0<code>*.<\/code><a href=\"http:\/\/firmachka.pro\" rel=\"noopener noreferrer nofollow\"><code>firmachka.pro<\/code><\/a>, \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p>SNI-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0442\u044b\u0440\u0451\u0445 DNS-\u0438\u043c\u0451\u043d (<code>mail<\/code>,\u00a0<code>autodiscover<\/code>,\u00a0<code>portal<\/code>,\u00a0<code>lb<\/code>) \u043d\u0430 \u043e\u0434\u043d\u043e\u043c IP.<\/p>\n<\/li>\n<li>\n<p>SSL-offload + TLS 1.3 \u0431\u0435\u0437 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u0432 \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0435 <a href=\"https:\/\/www.cloud4y.ru\/cloud-services\/corporate-mail\/?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=habr-post&amp;utm_content=exchange-balancing&amp;utm_term=exchange\" rel=\"noopener noreferrer nofollow\">Exchange<\/a> 2019 DAG \u0438 \u0432\u0435\u0431-\u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0437\u0430 \u043e\u0434\u043d\u0438\u043c \u0444\u0440\u043e\u043d\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0430\u0437\u043e\u0432\u0443\u044e DoS-\u0437\u0430\u0449\u0438\u0442\u0443 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u0436\u0435\u043b\u0435\u0437\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>HAProxy:\u00a0<a href=\"https:\/\/docs.haproxy.org\/2.8\/configuration.html\" rel=\"noopener noreferrer nofollow\">https:\/\/docs.haproxy.org\/2.8\/configuration.html<\/a><\/p>\n<\/li>\n<li>\n<p>\u00abLoad Balancing in Exchange Server\u00bb:\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/exchange\/architecture\/client-access\/load-balancing\" rel=\"noopener noreferrer nofollow\">https:\/\/learn.microsoft.com\/en-us\/exchange\/architecture\/client-access\/load-balancing<\/a><\/p>\n<\/li>\n<li>\n<p>\u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e security-headers:\u00a0<a href=\"https:\/\/owasp.org\/www-project-secure-headers\/\" rel=\"noopener noreferrer nofollow\">https:\/\/owasp.org\/www-project-secure-headers\/<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/933070\/\"> https:\/\/habr.com\/ru\/articles\/933070\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2><\/h2>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<strong> <\/strong>\u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u0415\u0436\u043a\u043e\u0432 \u0438\u0437<strong> <\/strong>\u0438\u0437 Cloud4Y. \u041e\u0434\u0438\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IPv4, \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Exchange \u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u2014 \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043a\u0430? \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a\u00a0\u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0435\u0451, \u0437\u0430\u0432\u0435\u0434\u044f \u0432\u0441\u0451 \u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u043e \u0437\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c IP \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443.   <\/p>\n<div class=\"floating-image\">\n<figure class=\"float bordered full-width\"><\/figure>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0424\u0438\u0440\u043c\u0430\u0447\u043a\u0430\u00bb (\u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u2014 <a href=\"http:\/\/firmachka.pro\" rel=\"noopener noreferrer nofollow\">firmachka.pro<\/a>) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Exchange Server 2019 \u043f\u0435\u0440\u0435\u0432\u0430\u043b\u0438\u043b\u043e \u0437\u0430 \u0441\u043e\u0442\u043d\u044e, \u0430 \u0442\u0440\u0430\u0444\u0438\u043a \u043a \u0434\u0432\u0443\u043c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430\u043c \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0432\u044b\u0440\u043e\u0441 \u043f\u043e\u0441\u043b\u0435 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u043a\u0430\u043c\u043f\u0430\u043d\u0438\u0438. \u0423 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IPv4.<\/p>\n<\/div>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<ol>\n<li>\n<p>\u041e\u0434\u0438\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IP-\u0430\u0434\u0440\u0435\u0441.<\/p>\n<\/li>\n<li>\n<p>SNI-\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 DNS-\u0438\u043c\u0451\u043d.<\/p>\n<\/li>\n<li>\n<p>SSL-offload (TLS 1.2 \/ 1.3).<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 DoS, health-checks, \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u0434\u043b\u044f DAG-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Exchange \u0438 \u0434\u0432\u0443\u0445 \u0432\u0435\u0431-\u0443\u0437\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>DNS-\u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0441\u0430\u043c\u0430 DAG-\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u00a0<strong>\u043d\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u044e\u0442\u0441\u044f<\/strong>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 DNS-\u0437\u0430\u043f\u0438\u0441\u0438 (A-\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f mail, autodiscover, portal, lb) \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 HAProxy.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0440\u0442\u044b 25, 80, 443 \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u043d\u0430 \u0444\u0430\u0439\u0440\u0432\u043e\u043b\u0435 \u0434\u043e HAProxy.<\/p>\n<\/li>\n<li>\n<p>Exchange DAG \u0438 \u0432\u0435\u0431-\u043f\u043e\u0440\u0442\u0430\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c sudo-\u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 HAProxy.<\/p>\n<\/li>\n<\/ul>\n<h3>2. \u0422\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u044f \u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/h3>\n<figure class=\"full-width\"><\/figure>\n<p>\u2022 HAProxy \u2265 2.4 \u0438\u0437 backports\/debian-bookworm.<br \/>\u2022 Exchange Server 2019 CU13 (\u0434\u0432\u0435 \u043d\u043e\u0434\u044b DAG).<br \/>\u2022 \u041f\u043e\u0440\u0442\u0430\u043b \u043d\u0430 IIS 10 \/ <a href=\"http:\/\/ASP.NET\" rel=\"noopener noreferrer nofollow\">ASP.NET<\/a> Core.<\/p>\n<h3>3. \u041e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b *.pem \u0432 \/etc\/ssl\/private<\/h3>\n<h4>3.1. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442<\/h4>\n<p>\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0443\u0436\u0435\u043d \u043e\u0434\u0438\u043d \u2014\u00a0<code>*.<\/code><a href=\"http:\/\/firmachka.pro\" rel=\"noopener noreferrer nofollow\"><code>firmachka.pro<\/code><\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c\u00a0<code>mail<\/code>,\u00a0<code>autodiscover<\/code>,\u00a0<code>portal<\/code>,\u00a0<code>lb<\/code>\u00a0\u0438 \u043b\u044e\u0431\u044b\u0435 \u0431\u0443\u0434\u0443\u0449\u0438\u0435 \u0438\u043c\u0435\u043d\u0430.<\/p>\n<p>ACME-\u043a\u043b\u0438\u0435\u043d\u0442 \u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u0442 wildcard \u0447\u0435\u0440\u0435\u0437 DNS-01-\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"bash\">DOMAIN=\"firmachka.pro\" CERT_DIR=\"\/etc\/ssl\/private\"  certbot certonly \\         --agree-tos \\         --manual \\         --preferred-challenges dns \\         -d \"*.${DOMAIN}\" -d \"${DOMAIN}\" \\         --manual-public-ip-logging-ok  # \u0441\u043a\u043b\u0435\u0439\u043a\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 HAProxy cat \/etc\/letsencrypt\/live\/${DOMAIN}\/privkey.pem \\     \/etc\/letsencrypt\/live\/${DOMAIN}\/fullchain.pem \\     &gt; ${CERT_DIR}\/wildcard.${DOMAIN}.pem chmod 600 ${CERT_DIR}\/wildcard.${DOMAIN}.pem <\/code><\/pre>\n<blockquote>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 DNS-01 \u0447\u0435\u043b\u043b\u0435\u043d\u0434\u0436 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f DNS-\u043f\u043b\u0430\u0433\u0438\u043d\u044b Certbot<\/p>\n<\/blockquote>\n<h4>3.2. DH-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h4>\n<pre><code class=\"bash\">openssl dhparam -out \/etc\/haproxy\/certs\/dhparam.pem 2048 <\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439\u00a0<code>ssl-dh-param-file<\/code>. \u0411\u0435\u0437 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 DH-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u00abweak prime reuse\u00bb.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435\u00a0<code>systemctl reload haproxy<\/code>, \u0438\u043d\u0430\u0447\u0435 HAProxy \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443<\/p>\n<\/blockquote>\n<h3>4. \u041f\u043e\u043b\u043d\u044b\u0439 haproxy.cfg<\/h3>\n<h4>4.1. global<\/h4>\n<pre><code>global     log \/dev\/log    local0 notice     stats socket \/run\/haproxy\/admin.sock mode 660 level admin expose-fd listeners     stats timeout 30s     user haproxy     group haproxy     daemon      maxconn 20000      ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets prefer-client-ciphers     ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384     ssl-default-bind-ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384      ssl-dh-param-file \/etc\/haproxy\/certs\/dhparam.pem     tune.ssl.default-dh-param 2048 <\/code><\/pre>\n<p>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><code>log \/dev\/log local0 notice<\/code>\u00a0\u2014 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u0443\u0435\u043c \u0432 rsyslog; \u0443\u0440\u043e\u0432\u0435\u043d\u044c notice \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0434\u0438\u0441\u043a.<\/p>\n<\/li>\n<li>\n<p><code>stats socket<\/code>\u00a0\u2014 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043b\u044f Runtime API \u0438 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><code>maxconn 20000<\/code>\u00a0\u2014 \u043b\u0438\u043c\u0438\u0442 \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438: \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 50 \u041a\u0411\/conn \u21d2 \u22481 \u0413\u0411 RSS.<\/p>\n<\/li>\n<li>\n<p><code>ssl-default-bind-options<\/code>\u00a0\u2014 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c TLS 1.0\/1.1, \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c session tickets (\u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u0430\u0442\u0430\u043a resumption-tracking), \u043d\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0430\u0448 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0448\u0438\u0444\u0440\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><code>ssl-default-bind-ciphersuites<\/code>\u00a0\u2014 suite-\u044b \u0434\u043b\u044f TLS 1.3.<\/p>\n<\/li>\n<li>\n<p><code>tune.ssl.default-dh-param<\/code>\u00a0\u2014 fallback-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438\u00a0<code>ssl-dh-param-file<\/code>\u00a0\u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0427\u0430\u0441\u0442\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u2014 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00a0<code>ssl-default-bind-options<\/code>\u00a0\u0431\u0435\u0437\u00a0<code>prefer-client-ciphers<\/code>; \u0442\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u0440\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0432\u044b\u0431\u0435\u0440\u0443\u0442 RC4.<\/p>\n<\/blockquote>\n<h4>4.2. defaults<\/h4>\n<pre><code>defaults     mode    http     log     global     option  httplog     option  dontlognull     option  forwardfor     option  redispatch     option  http-server-close     retries 3          http-request set-header X-Forwarded-Proto https if { ssl_fc }      timeout connect 10s     timeout client  300s     timeout server  300s     errorfile 403 \/etc\/haproxy\/errors\/403.http     errorfile 503 \/etc\/haproxy\/errors\/503.http <\/code><\/pre>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><code>option http-server-close<\/code>\u00a0\u2014 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 keep-alive, \u0430 \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0432\u0435\u0442\u0430; \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u043d\u0430 TIME_WAIT.<\/p>\n<\/li>\n<li>\n<p><code>forwardfor<\/code>\u00a0+\u00a0<code>set-header X-Forwarded-Proto<\/code>\u00a0\u2014 OWA \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u0438\u0434\u0430 https:\/\/.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0439\u043c\u0430\u0443\u0442\u044b 300 s \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d\u044b \u043f\u043e\u0434 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 OWA.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0417\u0430\u0431\u044b\u0442\u044b\u0439\u00a0<code>option httpclose<\/code>\u00a0\u0432\u0435\u0434\u0451\u0442 \u043a \u043e\u0431\u0440\u044b\u0432\u0443 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u0447\u0435\u0440\u0435\u0437 OWA\/OWA Light.<\/p>\n<\/blockquote>\n<h4>4.3. frontend ft_http \u2014 \u043f\u043e\u0440\u0442 80<\/h4>\n<pre><code>frontend ft_http     bind *:80     mode http      acl host_portal hdr(host) -i portal.firmachka.pro     use_backend be_portal if host_portal      redirect scheme https code 301 if !host_portal <\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0440\u0442\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438 \u043f\u043e HTTP :80 (SEO-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 HTTPS (301).<\/p>\n<\/li>\n<\/ol>\n<h4>4.4. frontend ft_https \u2014 \u043f\u043e\u0440\u0442 443<\/h4>\n<pre><code>frontend ft_https     bind *:443 ssl crt \/etc\/ssl\/private\/wildcard.firmachka.pro.pem     mode http      http-response set-header X-Frame-Options SAMEORIGIN     http-response set-header X-Content-Type-Options nosniff     http-response set-header Strict-Transport-Security \"max-age=63072000; includeSubDomains\"      # \u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 DoS     stick-table type ip size 200k expire 30s store http_req_rate(10s)     http-request track-sc0 src     http-request deny status 429 if { sc_http_req_rate(0) gt 100 }      # ---------- ACL ----------     acl host_portal        hdr(host) -i portal.firmachka.pro     acl host_autodiscover  hdr(host) -i autodiscover.firmachka.pro      acl url_ecp path_beg -i \/ecp      # !!! \u0412\u0410\u0416\u041d\u041e: \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0435\u0442\u044c !!!     acl admin_network src 192.168.20.0\/24     http-request deny if url_ecp !admin_network      # ---------- \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f ----------     use_backend be_portal_https      if host_portal     use_backend be_exchange_unified  if host_autodiscover      default_backend be_exchange_unified <\/code><\/pre>\n<p>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u041e\u0434\u0438\u043d wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/autodiscover.firmachka.pro\" rel=\"noopener noreferrer nofollow\"><code>autodiscover.firmachka.pro<\/code><\/a>\u00a0\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u0442 \u0436\u0435 backend, \u0447\u0442\u043e \u0438\u00a0<code>mail<\/code>.<\/p>\n<\/li>\n<li>\n<p>Security-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0443\u0431\u0438\u0440\u0430\u044e\u0442 mixed-content \u0438 click-jacking.<\/p>\n<\/li>\n<li>\n<p><code>stick-table<\/code>\u00a0\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 &gt; 100 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\/10 s \u21d2 HTTP 429 Too Many Requests.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0449\u0438\u0442\u0430 ECP: \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438. Exchange \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c.<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u2022 \u0422\u0430\u0431\u043b\u0438\u0446\u0430 200 k \u043d\u0430 30 s \u2248 14 MB RAM. \u0421\u0442\u0430\u0442\u0443\u0441 \u0432 Runtime API:\u00a0<code>show table ft_https<\/code>.<br \/>\u2022 \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d IPv6, \u0437\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e stick-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 type ipv6.<\/p>\n<\/blockquote>\n<h4>4.5. frontend ft_smtp \u2014 \u043f\u043e\u0440\u0442 25<\/h4>\n<pre><code>frontend ft_smtp     bind *:25     mode tcp          # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439     stick-table type ip size 50k expire 1m store conn_rate(10s)     tcp-request connection track-sc0 src     tcp-request connection reject if { sc_conn_rate(0) gt 10 }          default_backend be_smtp <\/code><\/pre>\n<ul>\n<li>\n<p>Layer 4 proxy, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 STARTTLS-offload; Exchange \u0441\u0430\u043c \u043e\u0442\u0434\u0430\u0451\u0442 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442.<\/p>\n<\/li>\n<li>\n<p>10 conns \/ 10 s \u2192 reject (\u0431\u043e\u0440\u044c\u0431\u0430 \u0441 \u0431\u043e\u0442\u043d\u0435\u0442\u0430\u043c\u0438, \u043d\u0435 \u0432\u043b\u0438\u044f\u044f \u043d\u0430 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u0439 MX-\u0442\u0440\u0430\u0444\u0438\u043a).<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u0421\u0435\u0440\u044b\u0435 \u043b\u0438\u0441\u0442\u044b (greylisting) \u043b\u044e\u0431\u044f\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f. \u041f\u043e\u0434\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u0438\u043c\u0438\u0442 \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u043f\u043e\u0447\u0442\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443.<\/p>\n<\/blockquote>\n<h4>4.6. backend be_portal<\/h4>\n<pre><code>backend be_portal     mode http     balance roundrobin     option httpchk GET \/     http-check expect status 200     server portal01 192.168.20.10:80  check inter 3s rise 2 fall 3     server portal02 192.168.20.11:80  check inter 3s rise 2 fall 3 <\/code><\/pre>\n<ul>\n<li>\n<p><code>rise 2 \/ fall 3<\/code>\u00a0\u2014 \u0443\u0437\u0435\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u0437\u0434\u043e\u0440\u043e\u0432\u044b\u043c\u00bb \u043f\u043e\u0441\u043b\u0435 \u0434\u0432\u0443\u0445 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0447\u0435\u043a\u043e\u0432 \u0438 \u00ab\u0431\u043e\u043b\u044c\u043d\u044b\u043c\u00bb \u043f\u043e\u0441\u043b\u0435 \u0442\u0440\u0451\u0445 \u043d\u0435\u0443\u0434\u0430\u0447.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0445\u0435\u043c\u0430 round-robin \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442: \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 Redis-\u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u043d\u0435\u0442 state-stickiness.<\/p>\n<\/li>\n<\/ul>\n<h4>4.7. backend be_portal_https<\/h4>\n<pre><code>backend be_portal_https     mode http     balance roundrobin     option httpchk GET \/     http-check expect status 200     server portal01 192.168.20.10:443 ssl verify none check inter 3s rise 2 fall 3     server portal02 192.168.20.11:443 ssl verify none check inter 3s rise 2 fall 3 <\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0442\u0430\u043a\u0436\u0435 \u0448\u0438\u0444\u0440\u0443\u0435\u0442\u0441\u044f;\u00a0<code>verify none<\/code>\u00a0\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f VLAN.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 internal-CA, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u043d\u0430\u00a0<code>verify required ca-file \/etc\/ssl\/certs\/ca_portal.pem<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h4>4.8. backend be_exchange_unified<\/h4>\n<pre><code>backend be_exchange_unified     mode http     balance source     option httpchk GET \/owa\/healthcheck.htm     http-check expect status 200     server ex01 192.168.0.100:443 ssl verify none check inter 3s rise 2 fall 3     server ex02 192.168.0.101:443 ssl verify none check inter 3s rise 2 fall 3 <\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443\u00a0<code>balance source<\/code>?<\/p>\n<p>Exchange \u043a\u043b\u0435\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044e OWA \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443\u00a0<code>ClientAccessServer<\/code>. Sticky-cookie \u0442\u043e\u0436\u0435 \u0440\u0435\u0448\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0443, \u043d\u043e source-hash \u043f\u0440\u043e\u0449\u0435 \u0438 \u043d\u0435 \u043b\u043e\u043c\u0430\u0435\u0442 ActiveSync \u0441 legacy-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<p><code>healthcheck.htm<\/code>\u00a0\u2014 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 endpoint; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u00ab200 OK Healthy\u00bb \u0431\u0435\u0437 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<blockquote>\n<p>\u041d\u0430 \u0437\u0430\u043c\u0435\u0442\u043a\u0443<br \/>\u041f\u043e\u0441\u043b\u0435 CU-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f Microsoft \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441 \u00abHealthy\u00bb \u043d\u0430 \u00abOK\u00bb. \u041b\u043e\u0432\u0438\u0442\u0435 503? \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u00a0<code>curl -k<\/code>.<\/p>\n<\/blockquote>\n<h4>4.10. backend be_smtp<\/h4>\n<pre><code>backend be_smtp     mode tcp     balance roundrobin     option smtpchk EHLO firmachka.pro     server ex01 192.168.0.100:25 check     server ex02 192.168.0.101:25 check <\/code><\/pre>\n<p><code>option smtpchk<\/code>\u00a0\u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 EHLO \u0438 \u0436\u0434\u0451\u0442 \u043a\u043e\u0434\u0430 250. \u042d\u0442\u043e \u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0440\u0442 25 \u0432 \u00abgreen\u00bb \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u043c \u043f\u0430\u0434\u0435\u043d\u0438\u0438 Exchange.<\/p>\n<h4>4.11. listen stats<\/h4>\n<pre><code>listen stats     bind *:8404     stats enable     stats uri \/stats     stats realm \"HAProxy Statistics\"     stats auth admin:ChangeMeNow!     stats refresh 30s <\/code><\/pre>\n<ul>\n<li>\n<p>\u0412\u0435\u0431-\u043f\u0430\u043d\u0435\u043b\u044c \u043f\u043e HTTP (\u043d\u0435 HTTPS). \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u044c\u0442\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0444\u0430\u0439\u0440\u0432\u043e\u043b\u043e\u043c!<\/p>\n<\/li>\n<li>\n<p><code>stats socket<\/code>\u00a0\u0438\u0437 \u0431\u043b\u043e\u043a\u0430 global \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0435\u0431-GUI \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f\u00a0<code>socat \/run\/haproxy\/admin.sock -<\/code>\u00a0\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432 Prometheus-exporter.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h3>5. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h3>\n<ol>\n<li>\n<p>TLS 1.3 + \u0441\u0442\u0440\u043e\u0433\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0448\u0438\u0444\u0440\u043e\u0432, SessionTickets \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0434\u0438\u043d wildcard-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>stick-table \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 100 req\/10 s \u0438\u043b\u0438 10 conn\/10 s \u043d\u0430 SMTP.<\/p>\n<\/li>\n<li>\n<p><code>maxconn 20000<\/code>\u00a0+ Linux 5.10 (SO_REUSEPORT) \u0434\u0430\u044e\u0442 5\u20136 \u0413\u0431\u0438\u0442\/\u0441 \u0431\u0435\u0437 CPU-\u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442. \u041e\u043f\u0446\u0438\u044f SO_REUSEPORT \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 HAProxy \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0434\u0435\u0440 CPU, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 (worker processes) HAProxy, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>Health-checks \u0440\u0430\u0437 \u0432 3 s \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 SLA \u2265 99.9 % \u0431\u0435\u0437 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0448\u0443\u043c\u0430.<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<h3>6. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<pre><code class=\"bash\">haproxy -c -f \/etc\/haproxy\/haproxy.cfg          # \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 curl -k<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-469296","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/469296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=469296"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/469296\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=469296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=469296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=469296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}