{"id":457875,"date":"2025-04-29T09:10:33","date_gmt":"2025-04-29T09:10:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=457875"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=457875","title":{"rendered":"<span>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0438\u043b\u0430\u043c\u0438 Haproxy, DoH, GeoIP, \u0437\u0430\u0449\u0438\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 mTLS \u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 Prometheus, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 ACME.SH<\/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<details class=\"spoiler\">\n<summary>\u0422\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0442\u0435\u043c\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 VLESS+TLS VLESS-REALITY<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e REALITY \u043c\u0435\u0442\u043e\u0434\u043e\u043c steal-oneself(\u0443\u043a\u0440\u0430\u0434\u0438 \u0441\u0435\u0431\u044f) \u0438 \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u044f\u0435\u0442 \u0438\u0445. \u041f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442 <a rel=\"noopener noreferrer nofollow\">1<\/a> <a rel=\"noopener noreferrer nofollow\">2<\/a> <a rel=\"noopener noreferrer nofollow\">3<\/a>. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 unix socket \u0432\u0437\u0430\u043c\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0440\u0442\u043e\u0432, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043d\u0435\u043b\u044c 3X-UI \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0435\u0437 \u0434\u043e\u043a\u0435\u0440\u0430 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f xray, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443. \u0422\u0430\u043a \u0436\u0435 \u0434\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 Haproxy \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f ocserv \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438. <\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u041f\u041e Ubuntu 24.04 LTS \u0438 Haproxy 2.8 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0432\u044b\u0448\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0432\u0435\u0440\u0441\u0438\u044f XCA 2.8, \u043d\u0430 2.9 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Haproxy \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 Haproxy \u0447\u0435\u0440\u0435\u0437 acme.sh, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0431\u0430\u0437\u043e\u0432\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c Apache2 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u043a\u0441\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0423\u0426, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c mTLS, \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 Prometheus \u0432 Haproxy. <\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 1. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b LE<\/h2>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044e \u043e\u0442 root \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>sudo su<\/code><br \/>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<br \/><code>apt update &amp;&amp; apt upgrade -y<\/code><br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u041f\u041e:<br \/><code>apt install -y haproxy htop socat netcat-traditional apache2<\/code><br \/>\u041f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 80 \u043f\u043e\u0440\u0442 apache2 \u043d\u0430 8080 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0438 SSL:<br \/>\u041e\u0442\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 <code>nano \/etc\/apache2\/ports.conf<\/code> \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u0432\u0438\u0434\u0443 \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435<\/p>\n<pre><code>Listen 8080  #&lt;IfModule ssl_module&gt; #Listen 443 #&lt;\/IfModule&gt;  #&lt;IfModule mod_gnutls.c&gt; #Listen 443 #&lt;\/IfModule&gt;<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c apache2 <code>systemctl restart apache2<\/code><\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c acme.sh \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432. <br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f acme:<br \/><code>adduser --system --disabled-password --disabled-login --home \/var\/lib\/acme --quiet --force-badname --group acme<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 haproxy:<br \/><code>adduser acme haproxy<\/code><br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 acme:<br \/><code>mkdir \/usr\/local\/share\/acme.sh\/<\/code><br \/>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 tmp \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c acme.sh \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<br \/><code>cd \/tmp\/ &amp;&amp; git clone https:\/\/github.com\/acmesh-official\/acme.sh.git &amp;&amp; cd acme.sh\/<\/code><br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c acme.sh \u0431\u0435\u0437 cron \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u043d\u0435\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<br \/><code>.\/acme.sh --install --no-cron --no-profile --home \/usr\/local\/share\/acme.sh<\/code><br \/>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430: <br \/><code>ln -s \/usr\/local\/share\/acme.sh\/acme.sh \/usr\/local\/bin\/<\/code><br \/>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e acme.sh: <br \/><code>chmod 755 \/usr\/local\/share\/acme.sh\/<\/code><br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432:<br \/><code>mkdir \/etc\/haproxy\/certs<\/code><br \/>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430:<br \/><code>chown haproxy:haproxy \/etc\/haproxy\/certs<\/code><br \/>\u0412\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u0430\u0432\u0430:<br \/><code>chmod 770 \/etc\/haproxy\/certs<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 acme.sh, \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <em>acme<\/em>:<br \/><code>sudo -u acme -s<\/code><br \/><code>acme.sh --register-account --server letsencrypt -m example@mail.com<\/code><br \/>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0423\u0426 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e ZeroSSL \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 RU:<br \/><code>acme.sh --set-default-ca --server letsencrypt<\/code><br \/>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c <code>acme.sh --update-account <\/code><br \/>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 ACCOUNT_THUMBPRINT \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Haproxy.<br \/>\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>exit<\/code><\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Haproxy<br \/>\u0421\u043e\u0442\u0440\u0435\u043c \u0438\u043c\u0435\u044e\u0449\u0443\u044e\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>&gt; \/etc\/haproxy\/haproxy.cfg<\/code><br \/>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b <code>nano \/etc\/haproxy\/haproxy.cfg<\/code><br \/>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0435\u043a\u0446\u0438\u044e Global, \u0432 \u0437\u0430\u043c\u0435\u043d &#171;*<em>ACCOUNT_THUMBPRINT*&#187;<\/em> \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 <em>acme.sh &#8212;update-account, <\/em>\u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0430\u043c\u0438, \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e tls1.2 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c tls1.3<\/p>\n<pre><code>global         log \/dev\/log    local0         log \/dev\/log    local1 notice         chroot \/var\/lib\/haproxy         stats socket \/var\/run\/haproxy\/admin.sock level admin mode 660         setenv ACCOUNT_THUMBPRINT '*ACCOUNT_THUMBPRINT*' # \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 acme         stats timeout 30s         user    haproxy         group   haproxy         daemon     # https:\/\/ssl-config.mozilla.org\/     # \u0423\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438 ( Intermediate ) Supports Firefox 27, Android 4.4.2, Chrome 31, Edge, IE 11 on Windows 7, Java 8u31, OpenSSL 1.0.1, Opera 20, Safari 9         ssl-default-bind-curves X25519:prime256v1:secp384r1         ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256         ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.2 no-tls-tickets          ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256         ssl-default-server-options ssl-min-ver TLSv1.2 no-tls-tickets      # TLS 1.3 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0437 \u043e\u0442\u043a\u0430\u0442\u0430 \u043a TLS 1.2  ( Modern ) Supports Firefox 63, Android 10.0, Chrome 70, Edge 75, Java 11, OpenSSL 1.1.1, Opera 57, Safari 12.1 #        ssl-default-bind-curves X25519:prime256v1:secp384r1 #        ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 #        ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.3 no-tls-tickets  #        ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 #        ssl-default-server-options ssl-min-ver TLSv1.3 no-tls-tickets          ssl-dh-param-file \/etc\/haproxy\/dh4096.pem # openssl dhparam -out \/etc\/haproxy\/dh4096.pem 4096 #        tune.ssl.default-dh-param 2048       # \u0422\u044e\u043d\u0438\u043d\u0433 http\/2         tune.h2.initial-window-size 536870912 # \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.         tune.h2.fe.max-concurrent-streams 512 # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.         tune.h2.be.max-concurrent-streams 512 # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. <\/code><\/pre>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c DH \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439: <code>openssl dhparam -out \/etc\/haproxy\/dh4096.pem<\/code><\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0435\u043a\u0446\u0438\u0438 defaults \u0438 resolvers \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d \u043d\u0430 backend&#8217;\u0435<\/p>\n<pre><code>defaults        log global        mode http        option httplog        option dontlognull        timeout connect 40s        timeout client  1m        timeout server  1m        timeout tunnel 1h        timeout http-request 30s        errorfile 400 \/etc\/haproxy\/errors\/400.http        errorfile 403 \/etc\/haproxy\/errors\/403.http        errorfile 408 \/etc\/haproxy\/errors\/408.http        errorfile 500 \/etc\/haproxy\/errors\/500.http        errorfile 502 \/etc\/haproxy\/errors\/502.http        errorfile 503 \/etc\/haproxy\/errors\/503.http        errorfile 504 \/etc\/haproxy\/errors\/504.http  resolvers dnsserver         nameserver ns1 127.0.0.1:53         parse-resolv-conf         resolve_retries       3         timeout resolve       1s         timeout retry         1s         hold other           30s         hold refused         30s         hold nx              30s         hold timeout         30s         hold valid           10s         hold obsolete        30s<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c http \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 (\u043f\u043e\u0440\u0442 80)<\/p>\n<pre><code>frontend f_http         bind *:80         bind [::]:80         mode http      # \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u043c \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u044e\u0437\u0435\u0440 \u0430\u0433\u0435\u043d\u0442\u044b         http-request reject if { req.hdr(user-agent) -m len le 32 }         http-request reject if { req.hdr(user-agent) -m sub evil }      # \u043e\u0442\u0432\u0435\u0442\u0438\u043c \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 ACME         http-request return status 200 content-type text\/plain lf-string \"%[path,field(-1,\/)].${ACCOUNT_THUMBPRINT}\\n\" if { path_beg '\/.well-known\/acme-challenge\/'}         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-request redirect scheme https code 301 unless { ssl_fc }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c TCP \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043d\u0430 443 \u043f\u043e\u0440\u0442\u0443 \u0434\u043b\u044f SSL Passthrough, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c SSH \u043d\u0430 443 \u043f\u043e\u0440\u0442\u0443.<\/p>\n<pre><code>frontend f_tcp         bind *:443    # ipv4 SSL Passthrough         bind [::]:443 # ipv6 SSL Passthrough         mode tcp         option tcplog         tcp-request inspect-delay 3s      # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432         stick-table type ip size 1m expire 10s store conn_cur         tcp-request session track-sc0 src         tcp-request session reject if { sc_conn_cur(0) gt 240 }         tcp-request content capture req.ssl_sni len 10         tcp-request content accept if { req_ssl_hello_type 1 } or !{ req_ssl_hello_type 1 }      # \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f          use_backend tcp-ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 } or !{ req.ssl_hello_type 1 } { req.len 0 } #use_backend tcp-ssh if !{ req.ssl_hello_type 1 } { req.len 0 }          use_backend tcp_to_https if { req.ssl_sni -i one.example.ru } <\/code><\/pre>\n<p> \u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c https \u0444\u0440\u043e\u043d\u0442\u0435\u0434 <\/p>\n<pre><code>frontend f_https #          bind abns@frontendhttps.sock accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 strict-sni tfo         http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-after-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains;\" # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS         stick-table type ip size 100k expire 5m store http_req_rate(10s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 300 }         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/https-status-443 }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0440\u0430\u0432\u043a\u0430 *_sni<\/summary>\n<div class=\"spoiler__content\">\n<p>req.ssl_sni &#8212; \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a SNI \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 SSL-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438  \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434.<br \/>ssl_fc_sni &#8212; \u041f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 SSL-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u044e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u0430 http \u0431\u0435\u043a\u0435\u043d\u0434\u044b.<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f backend \u0441\u0435\u043a\u0446\u0438\u0438 <\/p>\n<pre><code>backend tcp-ssh # \u0411\u0435\u043a\u0435\u043d\u0434 \u0434\u043b\u044f SSH         mode tcp         option http-keep-alive         timeout http-keep-alive 30s         server ssh 127.0.0.1:22 check port 22 backend tcp_to_https #          mode tcp         server s1 abns@frontendhttps.sock send-proxy-v2-ssl-cn tfo check          retry-on conn-failure empty-response response-timeout <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e haproxy <code>haproxy -f \/etc\/haproxy\/haproxy.cfg -c <\/code><br \/>\u0415\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 <em>Configuration file is valid <\/em>\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<em> <\/em><code>systemctl restart haproxy<\/code><\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0432\u044b\u0434\u0430\u0447\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f acme:<br \/><code>sudo -u acme -s<\/code><br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 one:<br \/><code>acme.sh --issue -d one.example.ru --stateless --ecc<\/code><br \/>\u041f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 deploy-hook \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:<\/p>\n<pre><code>DEPLOY_HAPROXY_HOT_UPDATE=yes \\ DEPLOY_HAPROXY_STATS_SOCKET=\/var\/run\/haproxy\/admin.sock \\ DEPLOY_HAPROXY_PEM_PATH=\/etc\/haproxy\/certs \\ acme.sh --deploy -d one.example.ru --deploy-hook haproxy<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 crontab \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>acme.sh --install-cronjob<\/code> .<br \/>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<br \/><code>echo \"show ssl cert \/etc\/haproxy\/certs\/one.example.ru\" | nc -U \/var\/run\/haproxy\/admin.sock | grep Status<\/code><br \/>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 &#8216;Status: Used&#8217; \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <em>one.example.ru\/https-status-443<\/em> \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c <strong>Status 200 OK! Your IP (\u0412\u0430\u0448 IP)<\/strong>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u0442\u0430\u043f\u0443, \u0437\u0430\u0449\u0438\u0442\u0435 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 FireHol \u0438 GeoIP \u043f\u043e GeoIP \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0438\u043d\u0435\u043d\u0442\u043e\u0432. <\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 2. \u0421\u043f\u0438\u0441\u043a\u0438 FireHol, GeoIP \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 rate limit<\/h2>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432<br \/>mkdir \/etc\/haproxy\/geoip \/etc\/haproxy\/firehol \/etc\/haproxy\/scripts<br \/>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 firehol, \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u0447\u0438\u0441\u0442\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a IP \u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439,<br \/><code>nano \/etc\/haproxy\/scripts\/firehol.sh<\/code><\/p>\n<pre><code>#!\/bin\/bash  # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 TMP_DIR=\"\/tmp\/firehol\" DEST_DIR=\"\/etc\/haproxy\/firehol\"  # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e mkdir -p \"$TMP_DIR\"  # \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b urls=(     \"https:\/\/raw.githubusercontent.com\/firehol\/blocklist-ipsets\/master\/firehol_level1.netset\"     \"https:\/\/raw.githubusercontent.com\/firehol\/blocklist-ipsets\/master\/firehol_level2.netset\"     \"https:\/\/raw.githubusercontent.com\/firehol\/blocklist-ipsets\/master\/firehol_level3.netset\"     \"https:\/\/raw.githubusercontent.com\/firehol\/blocklist-ipsets\/master\/firehol_abusers_1d.netset\" )  files=(\"level1.acl\" \"level2.acl\" \"level3.acl\" \"abusers_1d.acl\")  for i in \"${!urls[@]}\"; do     curl -s \"${urls[$i]}\" -o \"$TMP_DIR\/${files[$i]%.acl}.netset\" done  # \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u043e\u0442 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0438 \u043f\u0443\u0441\u0442\u044b\u0445 \u0441\u0442\u0440\u043e\u043a for file in \"${files[@]}\"; do     netset_file=\"$TMP_DIR\/${file%.acl}.netset\"     acl_file=\"$TMP_DIR\/$file\"     grep -vE '^\\s*#|^\\s*$' \"$netset_file\" &gt; \"$acl_file\" done  # \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c md5 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 declare -A md5s for file in \"${files[@]}\"; do     md5s[\"$file\"]=$(md5sum \"$TMP_DIR\/$file\" | awk '{ print $1 }') done  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0438\u0445 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 for file in \"${files[@]}\"; do     dest_file=\"$DEST_DIR\/$file\"     if [[ ! -f \"$dest_file\" ]] || [[ \"$(md5sum \"$dest_file\" | awk '{ print $1 }')\" != \"${md5s[$file]}\" ]]; then         cp \"$TMP_DIR\/$file\" \"$dest_file\"         echo \"\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d \u0444\u0430\u0439\u043b: $dest_file\"     fi done  chown -R haproxy:haproxy \/etc\/haproxy\/firehol\/ # \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e rm -rf \"$TMP_DIR\" <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 4 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/etc\/haproxy\/firehol<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c GeoIP \u0441\u043f\u0438\u0441\u043a\u0438 IPv4+IPv6<br \/><code>nano \/etc\/haproxy\/scripts\/geoip.sh<\/code><\/p>\n<pre><code>#!\/bin\/bash # https:\/\/github.com\/Loyalsoldier\/geoip\/blob\/release\/GeoLite2-Country-Locations-en.csv  GEOIP_ACL=\"\/etc\/haproxy\/geoip\" GEOIP_TEMP=\"\/tmp\"   function DownloadDB () {         # \u041e\u0447\u0438\u0441\u0442\u0438\u043c \u0441\u0442\u0430\u0440\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:         rm -rf  $GEOIP_TEMP\/{*.csv,*.zip}          curl -o $GEOIP_TEMP\/geip_csv.zip https:\/\/raw.githubusercontent.com\/Loyalsoldier\/geoip\/release\/GeoLite2-Country-CSV.zip &amp;&amp; \\         unzip -j $GEOIP_TEMP\/geip_csv.zip -d $GEOIP_TEMP \"*IPv4.csv\" \"*en.csv\" \"*IPv6.csv\"          # \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c csv:         find $GEOIP_TEMP -depth -type f -name '*IPv4.csv' -exec mv {} $GEOIP_TEMP\/ips4.csv \\;         find $GEOIP_TEMP -depth -type f -name '*IPv6.csv' -exec mv {} $GEOIP_TEMP\/ips6.csv \\;         cat $GEOIP_TEMP\/ips4.csv $GEOIP_TEMP\/ips6.csv &gt; $GEOIP_TEMP\/ips.csv         find $GEOIP_TEMP -depth -type f -name '*en.csv' -exec mv {} $GEOIP_TEMP\/countres.csv \\; }  function CreateAcl () {         if [ ! -d $GEOIP_ACL ]; then                 mkdir -p $GEOIP_ACL         fi          while read line; do                 COUNTRY_CODE=$(echo $line | cut -d, -f5)                 COUNTRY_ID=$(echo $line | cut -d, -f1)                  CONTINENT_CODE=$(echo $line | cut -d, -f3)                 CONTINENT_ID=$(echo $line | cut -d, -f1)                  # \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043a\u0438                 cat $GEOIP_TEMP\/ips.csv | grep $COUNTRY_ID | cut -d, -f1 &gt; $GEOIP_ACL\/$COUNTRY_CODE.list                 cat $GEOIP_TEMP\/ips.csv | grep $CONTINENT_ID | cut -d, -f1 &gt; $GEOIP_ACL\/$CONTINENT_CODE.acl         done &lt;$GEOIP_TEMP\/countres.csv }  DownloadDB CreateAcl rm -rf  $GEOIP_TEMP\/{*.csv,*.zip} chown -R haproxy:haproxy \/etc\/haproxy\/geoip\/ systemctl restart haproxy <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c IP\/\u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439  \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0430\u043c \u0438 \u043a\u043e\u043d\u0442\u0438\u043d\u0435\u043d\u0442\u0430\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \/etc\/haproxy\/geoip<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 crontab \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437 \u0432 \u0441\u0443\u0442\u043a\u0438 \u0432 4\u0447 \u0443\u0442\u0440\u0430:<br \/><code>0 4 * * * \/etc\/haproxy\/scripts\/firehol.sh &amp;&amp; \/etc\/haproxy\/scripts\/geoip.sh &amp;&amp; systemctl restart haproxy &gt;\/dev\/null 2&gt;&amp;1  <\/code><\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c rate limit \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043a\u0438 firehol, \u0432 \u0441\u0435\u043a\u0446\u0438\u044e f_http \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 <em>mode http, <\/em>rate limit \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 30, \u043f\u043e\u0441\u043b\u0435 30 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 10 \u0441\u0435\u043a\u0443\u043d\u0434, \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u0441 IP \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u043b  \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0430\u0439\u0442\u0430 limit \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043b\u044f 80 \u043f\u043e\u0440\u0442\u0430 \u0441\u0442\u0430\u0432\u043b\u044e \u043c\u0435\u043d\u044c\u0448\u0435, \u0442.\u043a. \u0442\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e acme \u0438 redirect \u043d\u0430 https.<br \/>\u0447\u0435\u0440\u0435\u0437<em> tcp-request connection silent-drop if<\/em>  \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043a\u0438 firehol, content  \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, connection \u043e\u0431\u043e\u0440\u0432\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b.<br \/>frontend f_http \u0434\u043e\u043b\u0436\u0435\u043d \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u043e tcp-request<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>tcp-request connection <\/strong>&#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0438 \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f <strong>reject  <\/strong>\u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u044f\u0432\u043d\u044b\u0445 IP \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441\u043a\u0430\u043c\u0435\u0440\u043e\u0432\/\u0441\u043f\u0430\u043c\u0435\u0440\u043e\u0432 \u0438 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 DDoS, \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u0434\u0442\u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c.<br \/><strong>tcp-request session <\/strong>&#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0435\u0439 TCP, \u0435\u0441\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 rate limit, \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e.  <br \/><strong>tcp-request content  <\/strong>&#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u043f\u0440\u0435\u0442\u044b \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b.  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<br \/><strong>reject &#8212; <\/strong>\u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043e\u0442\u0432\u0435\u0442 \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438.<br \/><strong>silent-drop &#8212; <\/strong>\u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e\u0436\u0435 \u0447\u0442\u043e \u0438<strong> reject <\/strong>\u0442\u043e\u043b\u044c\u043a\u043e &#171;\u0442\u0438\u0445\u043e&#187; \u0431\u0435\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0443.<br \/><strong>accept &#8212; <\/strong>\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443.<br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 &#8216;<strong>!<\/strong>&#8216; \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 { src -f \/etc\/haproxy\/geoip\/RU.list }, \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e.<\/p>\n<\/div>\n<\/details>\n<pre><code>frontend f_http         bind *:80         bind [::]:80         mode http      # FireHOL IP List         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level1.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level2.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level3.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/abusers_1d.acl }       # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0434\u0440\u043e\u043f\u0430\u0435\u043c \u043d\u0430 \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0434\u043b\u044f http \u0444\u0440\u043e\u043d\u0442\u0430         stick-table type ip size 1m expire 10s store conn_cur         tcp-request session track-sc0 src         tcp-request session reject if { sc_conn_cur(0) gt 30 } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 TCP \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 240 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0437\u0430 10\u0441\u0435\u043a\u0443\u043d\u0434, \u0438 \u0441\u043f\u0438\u0441\u043a\u0438 firehol<br \/>frontend f_tcp \u0434\u043e\u043b\u0436\u0435\u043d \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>frontend f_tcp         bind *:443    # ipv4 SSL Passthrough         bind [::]:443 # ipv6 SSL Passthrough         mode tcp         option tcplog         tcp-request inspect-delay 3s      # FireHOL IP List         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level1.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level2.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level3.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/abusers_1d.acl }       # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432         stick-table type ip size 1m expire 10s store conn_cur         tcp-request session track-sc0 src         tcp-request session reject if { sc_conn_cur(0) gt 240 }         tcp-request session capture req.ssl_sni len 10         tcp-request content capture req.ssl_sni len 10         tcp-request content accept if { req_ssl_hello_type 1 } or !{ req_ssl_hello_type 1 } <\/code><\/pre>\n<p>\u041f\u0440\u043e GeoIP \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a, \u0432 \u0441\u0435\u043a\u0446\u0438\u044e f_http \u0438 f_tcp \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 firehol \u0441\u043f\u0438\u0441\u043a\u043e\u0432: <br \/><code>tcp-request connection reject if { src -f \/etc\/haproxy\/geoip\/AF.acl }<\/code>   \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0432 \u0432\u0441\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0410\u0444\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0438\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0438\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u0442\u0440\u0430\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d <a href=\"https:\/\/github.com\/Loyalsoldier\/geoip\/blob\/release\/GeoLite2-Country-Locations-en.csv\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 &#8216;!&#8217; \u043f\u0435\u0440\u0435\u0434 <em>{ src -f \/etc\/haproxy\/geoip\/AF.acl } <\/em>\u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0442\u0440\u0430\u0444\u0438\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430, \u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439, \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043a\u043e\u043d\u0442\u0438\u043d\u0435\u043d\u0442\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c acl, \u0430 \u0444\u0430\u0439\u043b\u044b \u0441\u0442\u0440\u0430\u043d \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c list.<\/p>\n<p>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f TCP:<br \/><code>use_backend tcp_ru { req.ssl_sni -i example.ru } { src -f \/etc\/haproxy\/geoip\/RU.list }<\/code><br \/>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d example.ru \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0439\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441 IP \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u0444\u0430\u0439\u043b RU.list. \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0438\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/><code>use_backend tcp_ru if { src -f \/etc\/haproxy\/geoip\/RU.list }<\/code><br \/>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0435\u0441\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441 IP \u0438\u0437 \u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 backend tcp.<\/p>\n<p><code>use_backend tcp_by if { src -f \/etc\/haproxy\/geoip\/BY.list }<\/code><br \/>\u0410 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441 IP \u0411\u0435\u043b\u043e\u0440\u0443\u0441\u0441\u0438\u0438 \u0443\u0439\u0434\u0443\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 backend tcp. <br \/>\u0412\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043d\u0430 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0431\u0435\u043a\u0435\u043d\u0434:<br \/><code>default_backend default_tcp <\/code><\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u044d\u043a\u0435\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c.<\/p>\n<p>\u0412\u0441\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 HTTP \u0444\u0440\u043e\u043d\u0442\u044d\u043d\u0434\u0435, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0411\u0435\u043b\u043e\u0440\u0443\u0441\u0441\u0438\u0438 \u044f\u0432\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0432 \u0438\u043c \u043e\u0431 \u044d\u0442\u043e\u043c \u043e\u0448\u0438\u0431\u043a\u043e\u0439 403 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u0438\u0445 IP \u0430\u0434\u0440\u0435\u0441\u043e\u043c:<br \/><code>http-request deny deny_status 403 content-type text\/plain lf-string \"Access denied, IP not from whitelist. Your IP %[src].\" if { src -f \/etc\/haproxy\/geoip\/BY.list }<\/code><\/p>\n<p>\u0418\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0420\u043e\u0441\u0441\u0438\u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u044d\u043a\u0435\u043d\u0434, \u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0411\u0435\u043b\u043e\u0440\u0443\u0441\u0441\u0438\u0438 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439, \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c default_backend \u043d\u0430 \u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0441\u043b\u0438 \u0438\u0445 IP \u043d\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0430\u0445 \u0441\u0442\u0440\u0430\u043d, \u043f\u0440\u0438\u043c\u0435\u0440:<br \/>\u0414\u043b\u044f \u0420\u043e\u0441\u0441\u0438\u0438 <code>use_backend http_ru if { src -f \/etc\/haproxy\/geoip\/RU.list }<\/code><br \/>\u0414\u043b\u044f \u0411\u0435\u043b\u043e\u0440\u0443\u0441\u0441\u0438\u0438 <code>use_backend http_by if { src -f \/etc\/haproxy\/geoip\/BY.list }<\/code><br \/>\u0418 \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0448\u0435\u043b \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u0441\u0442\u0440\u0430\u043d:<br \/><code>default_backend http_default<\/code><\/p>\n<p>\u0414\u043b\u044f Haproxy Enterprise (HAPEE) \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f, \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 MaxMind\u00a0\u0438\u00a0Digital Element, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 GeoIP.<\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 3. mTLS \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0423\u0426 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432<\/h2>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c <a href=\"https:\/\/www.hohnstaedt.de\/xca\/index.php\/download\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c<\/a> XCA  \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c ROOTCA \u0438 SUBCA<\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 XCA \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0411\u0414, \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0431\u0430\u0437\u044b, \u0441\u043e\u043e\u0431\u0449\u0438\u0442 \u0447\u0442\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 &#171;\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c&#187; \u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u043d\u0430 &#171;AES-256-CBC&#187;, \u0442\u0430\u043a \u0436\u0435 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430 &#171;SHA384&#187; \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f Netscape.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b98\/752\/855\/b9875285533752084f585cc129b3b319.PNG\" alt=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 XCA\" title=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 XCA\" width=\"640\" height=\"484\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b98\/752\/855\/b9875285533752084f585cc129b3b319.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b98\/752\/855\/b9875285533752084f585cc129b3b319.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 XCA<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0438, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 &#171;\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b&#187; \u0438 &#171;\u041d\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442&#187;<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439.<\/p>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bc6\/3b6\/78b\/bc63b678b9cc830af96634c893e890b7.PNG\" alt=\"\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\" title=\"\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\" width=\"875\" height=\"666\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/bc6\/3b6\/78b\/bc63b678b9cc830af96634c893e890b7.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bc6\/3b6\/78b\/bc63b678b9cc830af96634c893e890b7.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c\u043e\u0437\u0430\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0439, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0438 SHA384 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 &#171;CA&#187;<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd3\/130\/feb\/bd3130feb1efd4dbeb535112e90bd3ea.PNG\" alt=\"\u0421\u0443\u0431\u044a\u0435\u043a\u0442\" title=\"\u0421\u0443\u0431\u044a\u0435\u043a\u0442\" width=\"881\" height=\"669\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/bd3\/130\/feb\/bd3130feb1efd4dbeb535112e90bd3ea.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd3\/130\/feb\/bd3130feb1efd4dbeb535112e90bd3ea.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0421\u0443\u0431\u044a\u0435\u043a\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u0443\u0431\u044a\u0435\u043a\u0442, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0438\u043c\u044f \u0438 CN \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9c\/e53\/498\/a9ce53498701df18cfc3fc1a7b83e627.PNG\" alt=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430\" title=\"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430\" width=\"620\" height=\"342\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a9c\/e53\/498\/a9ce53498701df18cfc3fc1a7b83e627.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a9c\/e53\/498\/a9ce53498701df18cfc3fc1a7b83e627.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0438\u043f \u043a\u043b\u044e\u0447\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u0442\u0435 EC, \u0438 \u043a\u0440\u0438\u0432\u0443\u044e prime256v1 \u0438\u043b\u0438 secp384r1<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ff\/daf\/0d5\/0ffdaf0d5a578f6a567d78d6e1fd7e52.PNG\" alt=\"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\" title=\"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\" width=\"881\" height=\"667\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0ff\/daf\/0d5\/0ffdaf0d5a578f6a567d78d6e1fd7e52.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0ff\/daf\/0d5\/0ffdaf0d5a578f6a567d78d6e1fd7e52.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0434\u043b\u0438\u043d\u0443 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0442.\u0435. \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Key identifier, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0440\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0438 SAN, \u0447\u0435\u0440\u0435\u0437 &#171;\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c&#187; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c &#171;Copy CN&#187;<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8e5\/cf7\/b09\/8e5cf7b09e9b9673c3e94c1d3c559777.PNG\" alt=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430\" title=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430\" width=\"893\" height=\"667\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/8e5\/cf7\/b09\/8e5cf7b09e9b9673c3e94c1d3c559777.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8e5\/cf7\/b09\/8e5cf7b09e9b9673c3e94c1d3c559777.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c Critical. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c<\/p>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439<\/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\/1a1\/68d\/bbd\/1a168dbbd5c40cbd468e574b2f244863.PNG\" alt=\"\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\" title=\"\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\" width=\"872\" height=\"672\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/1a1\/68d\/bbd\/1a168dbbd5c40cbd468e574b2f244863.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1a1\/68d\/bbd\/1a168dbbd5c40cbd468e574b2f244863.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 &#171;\u041f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u0435&#187; \u0443\u043a\u0430\u0436\u0435\u043c \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430\u0448\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c ROOTCA.<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e86\/3c4\/7e0\/e863c47e01b4d0fd1f2ed9cac076ec5d.PNG\" alt=\"\u0421\u0443\u0431\u044a\u0435\u043a\u0442\" title=\"\u0421\u0443\u0431\u044a\u0435\u043a\u0442\" width=\"873\" height=\"667\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/e86\/3c4\/7e0\/e863c47e01b4d0fd1f2ed9cac076ec5d.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e86\/3c4\/7e0\/e863c47e01b4d0fd1f2ed9cac076ec5d.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0421\u0443\u0431\u044a\u0435\u043a\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u0443\u0431\u044a\u0435\u043a\u0442, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u043b\u044e\u0447 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u043c. <\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e68\/f35\/b9c\/e68f35b9c2330a37a50894da4aba4619.PNG\" alt=\"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\" title=\"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\" width=\"878\" height=\"671\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/e68\/f35\/b9c\/e68f35b9c2330a37a50894da4aba4619.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e68\/f35\/b9c\/e68f35b9c2330a37a50894da4aba4619.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e \u043a\u0430\u043a \u0432 ROOTCA, \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0442\u043b\u0438\u0447\u0438\u0435\u043c, \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0426\u0421 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0423\u0426, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0434\u043b\u0438\u043d\u0443 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043a\u0430\u043a 0<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b19\/0e2\/34e\/b190e234ee8fe83ed7f5c42e1bc538a9.PNG\" alt=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430\" title=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430\" width=\"873\" height=\"668\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b19\/0e2\/34e\/b190e234ee8fe83ed7f5c42e1bc538a9.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b19\/0e2\/34e\/b190e234ee8fe83ed7f5c42e1bc538a9.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e ROOTCA<\/p>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u044e\u0447 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u043f\u043e\u0434\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c SUBCA<\/p>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/50c\/bc5\/1cd\/50cbc51cdc39ff198cdd734a1313766b.PNG\" alt=\"\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\" title=\"\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\" width=\"877\" height=\"668\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/50c\/bc5\/1cd\/50cbc51cdc39ff198cdd734a1313766b.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/50c\/bc5\/1cd\/50cbc51cdc39ff198cdd734a1313766b.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0438 SUBCA \u0438 \u0448\u0430\u0431\u043b\u043e\u043d TLS_client<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3e6\/0e4\/c14\/3e60e4c1448bb4e8597a47c786d125e4.PNG\" alt=\"\u0421\u0443\u0431\u044a\u0435\u043a\u0442\" title=\"\u0421\u0443\u0431\u044a\u0435\u043a\u0442\" width=\"882\" height=\"671\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3e6\/0e4\/c14\/3e60e4c1448bb4e8597a47c786d125e4.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3e6\/0e4\/c14\/3e60e4c1448bb4e8597a47c786d125e4.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0421\u0443\u0431\u044a\u0435\u043a\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u0443\u0431\u044a\u0435\u043a\u0442, \u0432 CN \u043f\u0438\u0448\u0435\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 client, \u0430 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0438\u043c\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0438\u043c\u044f \u0434\u043e\u043c\u0435\u043d\u0430, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0438\u0441\u043a\u0430, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u044e\u0447.<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3d6\/484\/ff1\/3d6484ff18515cfe811faf42638f2c47.PNG\" alt=\"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\" title=\"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\" width=\"884\" height=\"671\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3d6\/484\/ff1\/3d6484ff18515cfe811faf42638f2c47.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3d6\/484\/ff1\/3d6484ff18515cfe811faf42638f2c47.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445 \u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0441\u0435 \u0433\u0430\u043b\u043e\u0447\u043a\u0438 Key indetifier, \u0438 \u0442\u0430\u043a \u0436\u0435 SAN \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c CN<\/p>\n<\/div>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd8\/840\/af3\/cd8840af32a28b2fe4c399c5f3e796ff.PNG\" alt=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430\" title=\"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430\" width=\"884\" height=\"672\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/cd8\/840\/af3\/cd8840af32a28b2fe4c399c5f3e796ff.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd8\/840\/af3\/cd8840af32a28b2fe4c399c5f3e796ff.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f critical.<\/p>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 PKCS#12 *.pfx <\/p>\n<figure class=\"bordered full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/70e\/e8f\/199\/70ee8f199cf1773d2c4c84233cc392c1.PNG\" alt=\"\u042d\u043a\u0441\u043f\u043e\u0440\u0442\" title=\"\u042d\u043a\u0441\u043f\u043e\u0440\u0442\" width=\"1311\" height=\"517\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/70e\/e8f\/199\/70ee8f199cf1773d2c4c84233cc392c1.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/70e\/e8f\/199\/70ee8f199cf1773d2c4c84233cc392c1.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u042d\u043a\u0441\u043f\u043e\u0440\u0442<\/figcaption><\/div>\n<\/figure>\n<div class=\"floating-image\">\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0432 &#171;\u041b\u0438\u0447\u043d\u043e\u0435&#187; \u0434\u043b\u044f Windows, \u0438 \u0434\u043b\u044f Android \u0432 &#171;\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b VPN \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&#187;<\/p>\n<\/div>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c ROOTCA \u0438 SUBCA \u0432 \u0444\u0430\u0439\u043b pem \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0438 \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e fullca.pem<\/p>\n<div class=\"floating-image\">\n<figure class=\"float full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ad\/308\/6ca\/1ad3086ca186e26b07ac8d90facfadf9.PNG\" alt=\"CRL\" title=\"CRL\" width=\"1302\" height=\"538\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/1ad\/308\/6ca\/1ad3086ca186e26b07ac8d90facfadf9.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ad\/308\/6ca\/1ad3086ca186e26b07ac8d90facfadf9.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>CRL<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b revoked.crl, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043d\u0430 SUBCA \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u041f\u041a\u041c&gt;\u0426\u0421&gt;\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c CRL, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u043f\u0430\u0440\u0443 \u043b\u0435\u0442. <\/p>\n<\/div>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0434\u043b\u044f ROOTCA<\/p>\n<p>\u042d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c SUBCA \u0438 ROOTCA \u0432 \u0444\u0430\u0439\u043b revoked.crl \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u044b ROOTCA.pem, SUBCA.pem, fullca.pem \u0438 revoked.crl \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430.<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u0441\u0435\u043a\u0446\u0438\u044e f_tcp \u043f\u043e\u0434 <em>tcp_to_https<\/em> \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<br \/><code>use_backend tcp_to_mtls if { req.ssl_sni -i auth.example.ru }<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c backend<\/p>\n<pre><code>backend tcp_to_mtls         mode tcp         server mtls abns@frontendmtls.sock send-proxy-v2-ssl-cn tfo check         retry-on conn-failure empty-response response-timeout<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434<\/p>\n<pre><code>frontend f_mtls         bind abns@frontendmtls.sock tfo accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 ssl-min-ver TLSv1.3 strict-sni verify required ca-file \/etc\/haproxy\/ca\/SUBCA.pem ca-verify-file \/etc\/haproxy\/ca\/fullca.pem crl-file \/etc\/haproxy\/ca\/revoked.crl crt-ignore-err 10,23          http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         stick-table type ip size 100k expire 5m store http_req_rate(30s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 60 }         http-after-response set-header Strict-Transport-Security \"max-age=16000000;\"         http-request return status 403 content-type text\/plain lf-string \"Your certificate has expired, please contact the administrator\" if { ssl_c_verify 10 } #text\/html file \/certexpired.html         http-request return status 403 content-type text\/plain lf-string \"Your certificate has been revoked, please contact the administrator\" if { ssl_c_verify 23 } #text\/html file \/certrevoked.html         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/mtls-status-443 }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>frontendmtls<\/summary>\n<div class=\"spoiler__content\">\n<p>verify required &#8212; \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<br \/>ca-file &#8212; \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u044b.<br \/>ca-verify-file &#8212; \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 (\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 HAProxy 2.2 ), \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a CA \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 SERVER HELLO, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<br \/>crt-ignore-err &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043a\u043e\u0434\u043e\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u0435\u0441\u043b\u0438 \u043a\u043e\u0434 &#171;10&#187; &#8212; \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u0441\u0442\u0435\u043a \u0438\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b, &#171;23&#187; &#8212; \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043e\u0442\u043e\u0437\u0432\u0430\u043d.<br \/>ssl-min-ver TLSv1.3 &#8212; \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c TLSv1.3 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0431\u0435\u0437 \u043e\u0442\u043a\u0430\u0442\u0430 \u043a TLSv1.2<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<br \/><code>mkdir \/etc\/haproxy\/ca<\/code><br \/>\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043c \u0444\u0430\u0439\u043b\u044b SUBCA.pem fullca.pem \u0438 revoked.crl \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<br \/>\u0412\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430:<br \/><code>chmod 700 \/etc\/haproxy\/ca\/<\/code><br \/><code>chown -R haproxy:haproxy \/etc\/haproxy\/ca\/<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>haproxy -f \/etc\/haproxy\/haproxy.cfg -c <\/code><br \/>\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u043a, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441<code> systemctl restart haproxy<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 <strong><em>auth.example.ru <\/em><\/strong>\u0438 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 &#171;Status 200 OK! Your IP&#187; \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0443\u0442\u0438\/\u0434\u043e\u043c\u0435\u043d\u044b \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u043e\u043c\u0435\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438 f_tcp \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<br \/><code>use_backend tcp_to_mtls if { req.ssl_sni -i auth.example.ru } || { req.ssl_sni -i auth2.example.ru }<\/code><br \/>\u0418\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434 <em>tcp_to_mtls <\/em>\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043e\u043c\u0435\u043d\u043e\u043c. <\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 4. \u041c\u0435\u0442\u0440\u0438\u043a\u0438<\/h2>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 Prometheus \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 \u0432 Haproxy, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438, 1. \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 { path_beg \/path\/ } \u0438 \u043e\u0434\u0438\u043d \u0434\u043e\u043c\u0435\u043d \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u0434\u043e\u043f \u0434\u043e\u043c\u0435\u043d, \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u043c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u043b\u0438\u0431\u043e mTLS \u0441\u043e\u0437\u0434\u0430\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 SUBCA \u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a.<\/p>\n<p>\u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043e\u043c\u0435\u043d, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 f_tcp \u043f\u043e\u0434 tcp_to_mtls<br \/><code>use_backend tcp_to_metrics if { req.ssl_sni -i metrics.example.ru }<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c frontend \u0434\u043b\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u0441\u0435\u043a\u0446\u0438\u044e \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 IP, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0431\u0435\u043b\u044b\u0439 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 IP \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0435\u0433\u043e (\u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0440\u044b\u0442\u044c \u0437\u0430 mTLS):<\/p>\n<pre><code>frontend f_metrics         bind abns@metricshttps.sock accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 strict-sni tfo          tcp-request connection accept if { src -f \/etc\/haproxy\/geoip\/RU.list }          http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         stick-table type ip size 100k expire 5m store http_req_rate(30s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 60 }         http-after-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains;\"         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         stats enable         stats uri \/path\/stats         stats realm Haproxy\\ Statistics         stats refresh 10s         stats show-legends         stats hide-version         http-request use-service prometheus-exporter if { path_beg \/haproxy-exporter-path\/ } userlist metrics         user metrics insecure-password secretpassword<\/code><\/pre>\n<p>\u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 https:\/\/metrics.example.ru\/haproxy-exporter-path\/metrics<br \/>\u0441 \u043b\u043e\u0433\u0438\u043d\u043e\u043c metrics \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c secretpassword, \u0434\u043b\u044f Grafana \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c Haproxy 2 Full (ID 12693)<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435, \u043b\u0435\u0433\u043a\u0438\u043c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435\u043c \u0440\u0443\u043a \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e \u043f\u0430\u0440\u043e\u043b\u044e \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0443 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0423\u0426 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f Prometheus \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 mTLS frontend, \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code>frontend f_metrics_mtls         bind abns@metricshttps.sock tfo accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 ssl-min-ver TLSv1.3 strict-sni verify required ca-file \/etc\/haproxy\/ca\/metrics.pem ca-verify-file \/etc\/haproxy\/ca\/metricsfull.pem crl-file \/etc\/haproxy\/ca\/metrics.crl crt-ignore-err 10,23         tcp-request connection accept if { src -f \/etc\/haproxy\/geoip\/RU.list }          http-request reject if { req.hdr(user-agent) -m sub evil }          http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         stick-table type ip size 100k expire 5m store http_req_rate(30s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 90 }         http-after-response set-header Strict-Transport-Security \"max-age=16000000;\"         http-request return status 403 content-type text\/plain lf-string \"Your certificate has expired, please contact the administrator\" if { ssl_c_verify 10 }          http-request return status 403 content-type text\/plain lf-string \"Your certificate has been revoked, please contact the administrator\" if { ssl_c_verify 23 }          http-request use-service prometheus-exporter if { path_beg \/haproxy-exporter-path\/ } # exporter haproxy, \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f prometheus ( \/path_beg\/metrics )  #        use_backend node-exporter if { path_beg -i \/node-exporter-path\/ } # exporter \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Prometheus \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0443:<\/p>\n<pre><code>  - job_name: 'Haproxy'     scheme: https     static_configs:       - targets: ['mdata.example.ru:443']     metrics_path: \/mypath\/metrics     tls_config: #       ca_file: 'ca.crt'        cert_file: 'client.crt'        key_file: 'client.key'<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c node-exporter \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043d\u0430 9100 \u043f\u043e\u0440\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<br \/>\u0412 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043c\u0435\u0442\u0440\u0438\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>use_backend node-exporter if { path_beg -i \/node-exporter-path }<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c backend, \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u043d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434 \u0443\u0434\u0430\u043b\u0438\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u043f\u0443\u0442\u0438:<\/p>\n<pre><code>backend node-exporter         mode http         http-request replace-path \/node-exporter-path(\/)?(.*) \/\\2         server s1 127.0.0.1:9100<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c Web \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0435\u0440\u0435\u0434 \u0444\u0440\u043e\u043d\u0442\u0435\u0434\u043e\u043c \u043c\u0435\u0442\u0440\u0438\u043a:<\/p>\n<pre><code>frontend f_stats         bind abns@stats.sock         stats enable         stats uri \/stats         stats realm Haproxy\\ Statistics         stats refresh 10s         stats show-legends         stats hide-version         stats show-modules backend stats         mode http         http-request replace-path \/haproxy(\/)?(.*) \/\\2         server s1 abns@stats.sock<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 mTLS \u043f\u0440\u0430\u0432\u0438\u043b\u043e:<br \/><code>use_backend stats if { path_beg -i \/haproxy\/ }<\/code><br \/>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443<em> https:\/\/auth.example.ru\/haproxy\/stats<\/em><\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 Grafana<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dc1\/696\/099\/dc1696099ef0bb36427291d77e6e0c7b.PNG\" alt=\"HTTP\" title=\"HTTP\" width=\"1910\" height=\"942\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/dc1\/696\/099\/dc1696099ef0bb36427291d77e6e0c7b.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dc1\/696\/099\/dc1696099ef0bb36427291d77e6e0c7b.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>HTTP<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fdf\/b49\/84e\/fdfb4984edc90424531b907fb48b2fb1.PNG\" alt=\"Connections\" title=\"Connections\" width=\"1893\" height=\"576\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/fdf\/b49\/84e\/fdfb4984edc90424531b907fb48b2fb1.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fdf\/b49\/84e\/fdfb4984edc90424531b907fb48b2fb1.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Connections<\/figcaption><\/div>\n<\/figure>\n<\/div>\n<\/details>\n<h2>\u0427\u0430\u0441\u0442\u044c 5. 3X-UI, Reality TCP, XHTTP \u0438 DoH<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0430\u043d\u0435\u043b\u0438<br \/><code>adduser --system --disabled-password --disabled-login --home \/usr\/local\/x-ui --quiet --force-badname --group xray<\/code><\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:<br \/><code>bash &lt;(curl -Ls https:\/\/raw.githubusercontent.com\/mhsanaei\/3x-ui\/master\/install.sh)<\/code><br \/>\u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435  \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0440\u0442 \u043d\u0430 49004 \u0438\u043b\u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0430\u043c.<br \/>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0430\u0434\u0440\u0435\u0441 \u043f\u0443\u0442\u0438 \u0438 \u043b\u043e\u0433\u0438\u043d \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443:<br \/>1. \u041e\u0442\u043a\u0440\u043e\u0435\u043c \u044e\u043d\u0438\u0442 x-ui \u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 nano <code>\/etc\/systemd\/system\/x-ui.service<\/code><br \/>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043b\u0435 [Service] \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<br \/><code>User=xray<br \/>Group=haproxy<\/code><br \/>2. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f Socket: <code>mkdir \/var\/lib\/haproxy\/xui<\/code><br \/>3. \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 x-ui \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f Socket:<br \/><code>chown -R xray:xray \/etc\/x-ui\/ chown -R xray:xray \/usr\/local\/x-ui\/ chown -R xray:haproxy \/var\/lib\/haproxy\/xui<\/code><br \/>4. \u041f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e systemd: <code>systemctl daemon-reload<\/code><br \/>5. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 x-ui \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0440\u0430\u0431\u043e\u0442\u044b:<br \/><code>systemctl restart x-ui.service &amp;&amp; systemctl status x-ui.service<\/code><\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Haproxy:<br \/>\u0412 mTLS \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <br \/><code>use_backend http_3xui if { path_beg \/defaultpath\/ } || { path_beg \/3xui-path }<\/code><br \/>\u0412 defaultpath \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u0442\u044c \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u043d\u0435\u043b\u044c\u044e \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u0438.<br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c backend:<\/p>\n<pre><code>backend http_3xui # \u0410\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c 3X-UI         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         server s1 127.0.0.1:49004 check port 49004<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c haproxy \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0435\u0441\u043b\u0438 \u043f\u0430\u043d\u0435\u043b\u044c \u043e\u0442\u043a\u0440\u044b\u043b\u0430\u0441\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c TCP REALITY:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a inbound<\/summary>\n<div class=\"spoiler__content\">\n<p>1.\u0423\u043a\u0430\u0436\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: tcp_to_reality<br \/>2.\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b: VLESS<br \/>3.\u041f\u043e\u0440\u0442 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u043c<br \/>4.\u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b(\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442): TCP(RAW)<br \/>5.Proxy Protocol: Enable<br \/>6.Sockopt: Enable<br \/>7.TCP Fast Open: Enable<br \/>8.TCP Congestion: bbr<br \/>9.Tproxy: off<br \/>10.External Proxy: enable<br \/>  <code>[\u0422\u043e\u0442 \u0436\u0435]  [drive.example.ru]  [443]<\/code>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c: Reality<br \/>11.Xver: 1<br \/>12.uTLS \u043d\u0430 \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440, \u0443 \u043c\u0435\u043d\u044f firefox<br \/>13.Dest (Target): \/var\/lib\/haproxy\/fakehttps1.sock<br \/>14.SNI: drive.example.ru<br \/>15.Sniffing: \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d99\/786\/1b5\/d997861b5b8d0800958256195eb54323.PNG\" alt=\"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f1\" title=\"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f1\" width=\"522\" height=\"909\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d99\/786\/1b5\/d997861b5b8d0800958256195eb54323.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d99\/786\/1b5\/d997861b5b8d0800958256195eb54323.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f78\/111\/c06\/f78111c06879c091f91c9f234f27a1d8.PNG\" alt=\"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f 2\" title=\"\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f 2\" width=\"525\" height=\"959\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f78\/111\/c06\/f78111c06879c091f91c9f234f27a1d8.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f78\/111\/c06\/f78111c06879c091f91c9f234f27a1d8.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f 2<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c HAProxy, \u0432 f_tcp \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0434 <code>use_backend:<br \/>use_backend tcp_to_reality if { req.ssl_sni -i drive.example.ru }<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0435\u043a\u0435\u043d\u0434:<\/p>\n<pre><code>backend tcp_to_reality         mode tcp         server r1 \/x-ui\/reality.sock send-proxy tfo check         retry-on conn-failure empty-response response-timeout<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0434\u043b\u044f \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434 nextcloud:<\/p>\n<pre><code>frontend f_https_reality         bind \/var\/lib\/haproxy\/fakehttps1.sock accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 ssl-min-ver TLSv1.3 strict-sni mode 660 user haproxy group haproxy         http-request reject if { req.hdr(user-agent) -m sub evil }         acl url_discovery path \/.well-known\/caldav \/.well-known\/carddav         http-request redirect location \/remote.php\/dav\/ code 301 if url_discovery         http-request deny if { path -m sub \/. }         stick-table type ip size 100k expire 2m store http_req_rate(10s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 240 }         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains;\" # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/ } #        default_backend nextcloud<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:<br \/><code>haproxy -f \/etc\/haproxy\/haproxy.cfg -c<\/code><br \/>\u0415\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c nextcloud \u0443\u0431\u0438\u0440\u0430\u0435\u043c <em>http-request return status 200<\/em> \u0438 \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c  <em>default_backend nextcloud<\/em><br \/>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0435\u043a\u0435\u043d\u0434 \u0434\u043b\u044f nextcloud:<\/p>\n<pre><code>backend nextcloud         mode http         option forwardfor         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request set-header X-Forwarded-Proto http if !{ ssl_fc }         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-For %[src]         http-request add-header X-Real-Ip %[src]         server s1 127.0.0.1:49009<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e inbounds<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c XHTTP:<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c inbound \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438:<br \/>1. \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440.<br \/>2. \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b: VLESS<br \/>3. \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 IP: <em>\/var\/lib\/haproxy\/x-ui\/xhttp1.sock,0660<\/em><br \/>4. \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b(\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442): XHTTP<br \/>5. \u0425\u043e\u0441\u0442: \u0432\u0430\u0448 \u0434\u043e\u043c\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440: corp.example.ru<br \/>6. \u041f\u0443\u0442\u044c: \/secretpath<br \/>7. Mode: auto<br \/>8. Sockopt: enable<br \/>9. TCP Fast Open: enable<br \/>10. External Proxy: enable<br \/>    <code>[TLS]  [corp.example.ru]  [443]<\/code><br \/>11. \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c: \u043f\u0443\u0441\u0442\u043e<br \/>12. Sniffing: \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/679\/673\/7ca\/6796737caaef02fe93bd467b31724aff.PNG\" alt=\"XHTTP 1\" title=\"XHTTP 1\" width=\"522\" height=\"956\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/679\/673\/7ca\/6796737caaef02fe93bd467b31724aff.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/679\/673\/7ca\/6796737caaef02fe93bd467b31724aff.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>XHTTP 1<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/902\/243\/720\/902243720eece70b03006d640ed1484e.PNG\" alt=\"XHTTP 2\" title=\"XHTTP 2\" width=\"519\" height=\"872\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/902\/243\/720\/902243720eece70b03006d640ed1484e.PNG 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/902\/243\/720\/902243720eece70b03006d640ed1484e.PNG 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>XHTTP 2<\/figcaption><\/div>\n<\/figure>\n<\/div>\n<\/details>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 f_https:<br \/><code>use_backend xhttp if { req.hdr(host) -i corp.example.ru } { path_beg \/secretpathbeg\/ } || { path \/secretpath }<\/code><br \/><code>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0435\u043a\u0435\u043d\u0434:<\/code><\/p>\n<pre><code>backend xhttp # XHTTP: Beyond REALITY         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         retry-on conn-failure empty-response response-timeout         server x \/x-ui\/xhttp1.sock send-proxy tfo check<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e HAProxy, \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c.<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c DoH, \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438, \u0432 docker \u0438 \u0431\u0435\u0437, \u043f\u043e\u0439\u0434\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0431\u0435\u0437 docker. <br \/>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442:<br \/><code>curl -s -S -L https:\/\/raw.githubusercontent.com\/AdguardTeam\/AdGuardHome\/master\/scripts\/install.sh | sh -s -- -v<\/code><br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 systemctl stop AdGuardHome.service,<br \/>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e: <code>nano \/opt\/AdGuardHome\/AdGuardHome.yaml<\/code><\/p>\n<details class=\"spoiler\">\n<summary>AdGuardHome.yaml<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>http:   pprof:     port: 6060     enabled: false   address: 127.0.0.1:49005   session_ttl: 720h users:   - name: demo     password: $2y$10$9ho8XPNKtOBVRlfgQV8CFOVCOsFVpjXAHZRzICh0PDBA.dsaCbioO auth_attempts: 5 block_auth_min: 15 http_proxy: \"\" language: \"\" theme: auto dns:   bind_hosts:     - 127.0.0.2   port: 53   anonymize_client_ip: false   ratelimit: 20   ratelimit_subnet_len_ipv4: 24   ratelimit_subnet_len_ipv6: 56   ratelimit_whitelist: []   refuse_any: true   upstream_dns:     - 127.0.0.53   upstream_dns_file: \"\"   bootstrap_dns:     - 9.9.9.10     - 149.112.112.10     - 2620:fe::10     - 2620:fe::fe:10   fallback_dns: []   upstream_mode: load_balance   fastest_timeout: 1s   allowed_clients: []   disallowed_clients: []   blocked_hosts:     - version.bind     - id.server     - hostname.bind   trusted_proxies:     - 127.0.0.0\/8     - ::1\/128   cache_size: 4194304   cache_ttl_min: 0   cache_ttl_max: 0   cache_optimistic: false   bogus_nxdomain: []   aaaa_disabled: false   enable_dnssec: false   edns_client_subnet:     custom_ip: \"\"     enabled: false     use_custom: false   max_goroutines: 300   handle_ddr: true   ipset: []   ipset_file: \"\"   bootstrap_prefer_ipv6: false   upstream_timeout: 10s   private_networks: []   use_private_ptr_resolvers: true   local_ptr_upstreams: []   use_dns64: false   dns64_prefixes: []   serve_http3: false   use_http3_upstreams: false   serve_plain_dns: true   hostsfile_enabled: true tls:   enabled: false   server_name: \"\"   force_https: false   port_https: 0   port_dns_over_tls: 0   port_dns_over_quic: 0   port_dnscrypt: 0   dnscrypt_config_file: \"\"   allow_unencrypted_doh: true   certificate_chain: \"\"   private_key: \"\"   certificate_path: \"\"   private_key_path: \"\"   strict_sni_check: false querylog:   dir_path: \"\"   ignored: []   interval: 2160h   size_memory: 1000   enabled: true   file_enabled: true statistics:   dir_path: \"\"   ignored: []   interval: 24h   enabled: true filters:   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_1_Russian\/filter.txt     name: Ru filter     id: 1736931102   - enabled: false     url: https:\/\/raw.githubusercontent.com\/rebelion76\/bankiru_plus_adblock_list\/master\/bankiru_plus.txt     name: bankiru_plus     id: 1736931124   - enabled: false     url: https:\/\/raw.githubusercontent.com\/deathbybandaid\/piholeparser\/master\/Subscribable-Lists\/CountryCodesLists\/Russia.txt     name: \u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 RU     id: 1736931125   - enabled: false     url: https:\/\/easylist-downloads.adblockplus.org\/ruadlist.txt     name: ruadlist     id: 1736931126   - enabled: false     url: https:\/\/raw.githubusercontent.com\/deathbybandaid\/piholeparser\/master\/Subscribable-Lists\/ParsedBlacklists\/RU-AdList.txt     name: RU-AdList     id: 1736931127   - enabled: false     url: https:\/\/easylist-downloads.adblockplus.org\/cntblock.txt     name: RU Adlist Counters     id: 1736931128   - enabled: false     url: https:\/\/gist.githubusercontent.com\/drewpayment\/4a316423f7ff7df9dce63a041c478486\/raw\/6a509d262d7dd687c645349be3fc6217c0764768\/AdGuard%2520Russian%2520filter%2520-%2520Rules.txt      name: AdGuard Russian filter     id: 1736931118   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_1.txt     name: AdGuard DNS filter     id: 1   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_2.txt     name: AdAway Default Blocklist     id: 2   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_4.txt     name: Dan Pollock's List     id: 1736931097   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_30.txt     name: Phishing URL Blocklist (PhishTank and OpenPhish)     id: 1736931098   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_50.txt     name: uBlock\u2080 filters \u2013 Badware risks     id: 1736931099   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_33.txt     name: Steven Black's List     id: 1736931100   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_59.txt     name: AdGuard DNS Popup Hosts filter     id: 1736931101   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_3_Spyware\/filter.txt     name: Spyware     id: 1736931103   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_17_TrackParam\/filter.txt     name: Trackers     id: 1736931104   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_15_DnsFilter\/filter.txt     name: Ad Guard filter     id: 1736931107   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_11_Mobile\/filter.txt     name: Mobile     id: 1736931108   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_21_Annoyances_Other\/filter.txt     name: \u0420\u0430\u0437\u0434\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b     id: 1736931109   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_22_Annoyances_Widgets\/filter.txt     name: Widgets     id: 1736931110   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_20_Annoyances_MobileApp\/filter.txt     name: Widgets_Mobile     id: 1736931111   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_19_Annoyances_Popups\/filter.txt     name: \u0412\u0441\u043f\u043b\u044b\u0432\u0430\u0439\u043a\u0438 \u0441\u0430\u0439\u0442\u044b     id: 1736931112   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_23.txt     name: Windows Spy list     id: 1736931113   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_8.txt     name: nocoin     id: 1736931114   - enabled: false     url: https:\/\/blocklistproject.github.io\/Lists\/smart-tv.txt     name: smart-tv     id: 1736931115   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_49.txt     name: HaGeZi's Ultimate Blocklist     id: 1736931116   - enabled: false     url: https:\/\/adguardteam.github.io\/HostlistsRegistry\/assets\/filter_27.txt     name: OISD Blocklist Big     id: 1736931117   - enabled: false     url: https:\/\/raw.githubusercontent.com\/hant0508\/uBlock-filters\/master\/filters.txt     name: uBlock-filters     id: 1736931119   - enabled: false     url: https:\/\/raw.githubusercontent.com\/AdguardTeam\/FiltersRegistry\/master\/filters\/filter_10_Useful\/filter.txt     name: AdguardTeam     id: 1736931120   - enabled: false     url: https:\/\/filters.adtidy.org\/extension\/chromium-mv3\/filters\/24.txt     name: AdGuard Quick Fixes filter MV3     id: 1736931121   - enabled: false     url: https:\/\/gitlab.com\/eyeo\/anti-cv\/abp-filters-anti-cv\/-\/raw\/master\/russian.txt     name: Russian anti-cv     id: 1736931122   - enabled: false     url: https:\/\/filters.adtidy.org\/extension\/ublock\/filters\/1_optimized.txt     name: ublock optimized     id: 1736931123 whitelist_filters: [] user_rules: [] dhcp:   enabled: false   interface_name: \"\"   local_domain_name: lan   dhcpv4:     gateway_ip: \"\"     subnet_mask: \"\"     range_start: \"\"     range_end: \"\"     lease_duration: 86400     icmp_timeout_msec: 1000     options: []   dhcpv6:     range_start: \"\"     lease_duration: 86400     ra_slaac_only: false     ra_allow_slaac: false filtering:   blocking_ipv4: \"\"   blocking_ipv6: \"\"   blocked_services:     schedule:       time_zone: Local     ids: []   protection_disabled_until: null   safe_search:     enabled: false     bing: true     duckduckgo: true     ecosia: true     google: true     pixabay: true     yandex: true     youtube: true   blocking_mode: default   parental_block_host: family-block.dns.adguard.com   safebrowsing_block_host: standard-block.dns.adguard.com   rewrites: []   safe_fs_patterns:     - \/opt\/AdGuardHome\/userfilters\/*   safebrowsing_cache_size: 1048576   safesearch_cache_size: 1048576   parental_cache_size: 1048576   cache_time: 30   filters_update_interval: 24   blocked_response_ttl: 10   filtering_enabled: true   parental_enabled: false   safebrowsing_enabled: false   protection_enabled: true clients:   runtime_sources:     whois: true     arp: true     rdns: true     dhcp: true     hosts: true   persistent: [] log:   enabled: true   file: \"\"   max_backups: 0   max_size: 100   max_age: 3   compress: false   local_time: false   verbose: false os:   group: \"\"   user: \"\"   rlimit_nofile: 0 schema_version: 29<\/code><\/pre>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>allow_unencrypted_doh: true<\/code><br \/>\u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c<code> <em>demo,<\/em><\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440, \u043f\u043e\u0440\u0442 \u043f\u0430\u043d\u0435\u043b\u0438 49005, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u043f\u0438\u0441\u043a\u0438 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b.<\/p>\n<p>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c HAProxy, \u0432\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 f_tcp \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<br \/><code>use_backend tcp_to_mtls if { req.ssl_sni -i ns1.example.ru }<\/code><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043b\u0438 \u043f\u043e\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442, \u0438\u043b\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u0442 dns \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 5353.<\/p>\n<p>\u0412 f_https \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<br \/><code>use_backend http_adh if { ssl_fc_sni -i corp.example.ru } { path_beg -i \/<\/code>secretpathdns<code>\/ }<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u044d\u043a\u0435\u043d\u0434:<\/p>\n<pre><code>backend http_adh # DOH AdGuardHome         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request replace-path \/secretpath(\/)?(.*) \/\\2         server dns 127.0.0.1:49005 check port 49005<\/code><\/pre>\n<p><em>{ path_beg -i \/<\/em>secretpathdns<em>\/ }<\/em> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b dns-query, \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434 \u043f\u0443\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u0439\u0434\u0435\u0442 \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a \u043a DoH, \u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f DoH \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 <em>https:\/\/corp.examle.ru\/secretpath\/dns-query<\/em><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f AdGuardHome, \u0432 f_tcp \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<br \/><code>use_backend tcp_to_mtls if { req.ssl_sni -i ns1.example.ru }<\/code><br \/>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0435\u0441\u0435\u043c \u0432 f_mtls \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<br \/><code>use_backend http_adh if { ssl_fc_sni -i ns1.example.ru }<\/code><\/p>\n<p>\u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c HAProxy.<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 allow_unencrypted_doh: true \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c demo, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440, \u043f\u043e\u0440\u0442 \u043f\u0430\u043d\u0435\u043b\u0438 49005<\/p>\n<p> \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c HAProxy, \u0432\u043e \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 f_tcp \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<br \/><code>use_backend tcp_to_mtls if { req.ssl_sni -i ns1.example.ru } <\/code><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043b\u0438 \u043f\u043e\u043d\u0438\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442, \u0438\u043b\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u0442 dns \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 53535, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<br \/><code>os:<br \/> group: \"\"<br \/> user: \"\"<\/code><br \/>\u041d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 adguard:<br \/><code>os:<br \/> group: adguard<br \/> user: adguard<\/code><\/p>\n<p>\u0412 f_https \u0434\u043e\u0431\u0430\u0432\u0438\u043c:<br \/><code>use_backend http_adh if { ssl_fc_sni -i corp.example.ru } { path_beg -i \/secretpathdns\/ }<\/code> <br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u044d\u043a\u0435\u043d\u0434:<\/p>\n<pre><code>backend http_adh # DOH AdGuardHome         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request replace-path \/secretpath(\/)?(.*) \/\\2         server dns 127.0.0.1:49005 check port 49005<\/code><\/pre>\n<p>{ path_beg -i \/secretpathdns\/ } \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b dns-query, \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434 \u043f\u0443\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u0439\u0434\u0435\u0442 \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a \u043a DoH, \u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f DoH \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 <em>https:\/\/corp.examle.ru\/secretpath\/dns-query<\/em>  \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f AdGuardHome, \u0432 f_tcp \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443: <code>use_backend tcp_to_mtls if { req.ssl_sni -i ns1.example.ru }<\/code> \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0435\u0441\u0435\u043c \u0432 f_mtls \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443: <code>use_backend http_adh if { ssl_fc_sni -i ns1.example.ru }<\/code>  \u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c HAProxy.<\/p>\n<p>\u0418\u0442\u043e\u0433 \u043f\u043e 3X-UI \u043f\u0430\u043d\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430 mTLS, \u043a\u0440\u043e\u043c\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438, \u043e\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438\u0437 \u0432\u043d\u0435 \u043f\u043e \u0434\u043b\u0438\u043d\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u0441\u0430\u043c\u0438 inbound \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 unix socket \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 TFO, REALITY \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u043c steal-oneself, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c \u043e\u0442 \u0447\u0443\u0436\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430\/\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430, \u043e\u0442\u0432\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. <\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 6. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 ocserv:<br \/>1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e: <code>mkdir \/etc\/ocserv\/ssl<\/code><br \/>2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f acme \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 ocserv: <code>adduser acme ocserv<\/code><br \/>3. \u041c\u0435\u043d\u044f\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430: <code>chown ocserv:ocserv \/etc\/ocserv\/ssl<\/code><br \/>4.\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0430: <code>chmod 770 \/etc\/ocserv\/ssl<\/code><\/p>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f acme: <code>sudo -u acme -s <\/code><\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442:<code> acme.sh --issue -d example.com --stateless<\/code><br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c ocserv:<\/p>\n<pre><code>acme.sh --install-cert -d example.ru \\ --cert-file \/etc\/ocserv\/ssl\/example.ru.pem \\ --key-file \/etc\/ocserv\/ssl\/example.ru.key \\ --fullchain-file \/etc\/ocserv\/ssl\/fullchain.ru.pem \\ --reloadcmd \"systemctl restart ocserv\"<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0434\u043b\u044f \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0437\u0430 mTLS, \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GeoIP \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 Prometheus \u0438\u0437 HAProxy exporter, \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e REALITY.<\/p>\n<p><strong>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d\u043e\u0432, \u043f\u043e\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0441 path.<\/strong><\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 haproxy.cfg<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>global         log \/dev\/log    local0         log \/dev\/log    local1 notice         chroot \/var\/lib\/haproxy         stats socket \/var\/run\/haproxy\/admin.sock level admin mode 660         setenv ACCOUNT_THUMBPRINT '*ACCOUNT_THUMBPRINT*' # \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 acme         stats timeout 30s         user    haproxy         group   haproxy         daemon     # https:\/\/ssl-config.mozilla.org\/     # \u0423\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438 ( Intermediate ) Supports Firefox 27, Android 4.4.2, Chrome 31, Edge, IE 11 on Windows 7, Java 8u31, OpenSSL 1.0.1, Opera 20, Safari 9         ssl-default-bind-curves X25519:prime256v1:secp384r1 #:secp521r1:X448         ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256         ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.2 no-tls-tickets          ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305          ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256         ssl-default-server-options ssl-min-ver TLSv1.2 no-tls-tickets      # TLS 1.3 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0437 \u043e\u0442\u043a\u0430\u0442\u0430 \u043a TLS 1.2  ( Modern ) Supports Firefox 63, Android 10.0, Chrome 70, Edge 75, Java 11, OpenSSL 1.1.1, Opera 57, Safari 12.1 #        ssl-default-bind-curves X25519:prime256v1:secp384r1 #        ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 #        ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.3 no-tls-tickets  #        ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 #        ssl-default-server-options ssl-min-ver TLSv1.3 no-tls-tickets          ssl-dh-param-file \/etc\/haproxy\/dh4096.pem # openssl dhparam -out \/etc\/haproxy\/dh4096.pem 4096 #        tune.ssl.default-dh-param 2048       # \u0422\u044e\u043d\u0438\u043d\u0433 http\/2         tune.h2.initial-window-size 536870912 # \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.         tune.h2.fe.max-concurrent-streams 512 # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.         tune.h2.be.max-concurrent-streams 512 # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. #------------------------------------------ defaults        log global        mode http        option httplog        option dontlognull        timeout connect 40s        timeout client  1m        timeout server  1m        timeout tunnel 1h        timeout http-request 30s        errorfile 400 \/etc\/haproxy\/errors\/400.http        errorfile 403 \/etc\/haproxy\/errors\/403.http        errorfile 408 \/etc\/haproxy\/errors\/408.http        errorfile 500 \/etc\/haproxy\/errors\/500.http        errorfile 502 \/etc\/haproxy\/errors\/502.http        errorfile 503 \/etc\/haproxy\/errors\/503.http        errorfile 504 \/etc\/haproxy\/errors\/504.http #------------------------------------------ resolvers dnsserver         nameserver ns1 127.0.0.1:53         parse-resolv-conf         resolve_retries       3         timeout resolve       1s         timeout retry         1s         hold other           30s         hold refused         30s         hold nx              30s         hold timeout         30s         hold valid           10s         hold obsolete        30s #----------------------------------- frontend f_http         bind *:80         bind [::]:80         mode http      # FireHOL IP List         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level1.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level2.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level3.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/abusers_1d.acl }      # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0434\u0440\u043e\u043f\u0430\u0435\u043c \u043d\u0430 \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u0434\u043b\u044f http \u0444\u0440\u043e\u043d\u0442\u0430         stick-table type ip size 1m expire 10s store conn_cur         tcp-request session track-sc0 src         tcp-request session reject if { sc_conn_cur(0) gt 60 }      # \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u043c \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u044e\u0437\u0435\u0440 \u0430\u0433\u0435\u043d\u0442\u044b         http-request reject if { req.hdr(user-agent) -m len le 32 }         http-request reject if { req.hdr(user-agent) -m sub evil }      # \u043e\u0442\u0432\u0435\u0442\u0438\u043c \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 ACME         http-request return status 200 content-type text\/plain lf-string \"%[path,field(-1,\/)].${ACCOUNT_THUMBPRINT}\\n\" if { path_beg '\/.well-known\/acme-challenge\/' }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-request redirect scheme https code 301 unless { ssl_fc } #------------------------------------------ frontend f_tcp         bind *:443    # ipv4 SSL Passthrough         bind [::]:443 # ipv6 SSL Passthrough         mode tcp         option tcplog         tcp-request inspect-delay 3s      # FireHOL IP List         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level1.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level2.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/level3.acl }         tcp-request connection silent-drop if { src -f \/etc\/haproxy\/firehol\/abusers_1d.acl }      # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432         stick-table type ip size 1m expire 10s store conn_cur         tcp-request content track-sc0 src         tcp-request content reject if { sc_conn_cur(0) gt 240 }         tcp-request content capture req.ssl_sni len 10         tcp-request content accept if { req_ssl_hello_type 1 } or !{ req_ssl_hello_type 1 }      # \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f          use_backend tcp-ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 } or !{ req.ssl_hello_type 1 } { req.len 0 }          use_backend tcp_to_https if { req.ssl_sni -i corp.example.ru }          use_backend tcp_to_reality if { req.ssl_sni -i drive.example.ru }          use_backend tcp_to_metrics if { req.ssl_sni -i metrics.example.ru }          use_backend tcp_to_mtls if { req.ssl_sni -i auth.example.ru } || { req.ssl_sni -i ns1.example.ru }  #        use_backend tcp_to_ocserv if { req.ssl_sni -i example.ru } #------------------------------------------ frontend f_https #          bind abns@frontendhttps.sock accept-proxy ssl crt \/etc\/haproxy\/certs\/ ssl crt \/etc\/haproxy\/ssl\/ alpn h2,http\/1.1 strict-sni tfo         http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-after-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains;\" # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS         stick-table type ip size 100k expire 5m store http_req_rate(10s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 300 }         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/https-status-443 }          use_backend http_3xui_sub if { ssl_fc_sni -i corp.example.ru } { path_beg \/sub-path\/ } || { path_beg \/jsub-path\/ }         use_backend xhttp if { req.hdr(host) -i corp.example.ru } { path_beg -i \/secretpath\/ } || { path_beg -i \/secretpath }          use_backend http_adh if { ssl_fc_sni -i corp.example.ru } { path_beg -i \/secretpathdns\/ } # { path_beg \/dns-query\/ }  #        use_backend websocket if { req.hdr(Host) -i corp.example.ru } { path \/ws } || { path_beg \/ws\/ }  frontend f_mtls # \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f         bind abns@frontendmtlsadm.sock accept-proxy alpn h3,h2,http\/1.1 tfo ssl-min-ver TLSv1.3 ssl crt \/etc\/haproxy\/certs\/ verify required ca-file \/etc\/haproxy\/ca\/ca.pem ca-verify-file \/etc\/haproxy\/ca\/fullca.pem crl-file \/etc\/haproxy\/ca\/revoked.crl crt-ignore-err 10,23         http-request silent-drop if { path_end \/dns-query } || { path_beg \/dns-query\/ }         http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-after-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains;\" # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS         http-request return status 403 content-type text\/plain lf-string \"Your certificate has expired, please contact the administrator\" if { ssl_c_verify 10 }         http-request return status 403 content-type text\/plain lf-string \"Your certificate has been revoked, please contact the administrator\" if { ssl_c_verify 23 }         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/https-status-443 }          use_backend http_3xui if { ssl_fc_sni -i corp.example.ru } { path_beg \/defaultpath\/ } || { path_beg \/3xui-path }         use_backend stats if { path_beg -i \/haproxy\/ }         use_backend http_adh if { ssl_fc_sni -i ns1.example.ru }  #-- Statistics ---------------------------- frontend f_metrics_mtls         bind abns@metricshttps.sock tfo accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 ssl-min-ver TLSv1.3 strict-sni verify required ca-file \/etc\/haproxy\/ca\/metrics.pem ca-verify-file \/etc\/haproxy\/ca\/metricsfull.pem crl-file \/etc\/haproxy\/ca\/metrics.crl crt-ignore-err 10,23         tcp-request connection accept if { src -f \/etc\/haproxy\/geoip\/RU.list }         http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         stick-table type ip size 100k expire 5m store http_req_rate(30s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 90 }         http-after-response set-header Strict-Transport-Security \"max-age=16000000;\"         http-request return status 403 content-type text\/plain lf-string \"Your certificate has expired, please contact the administrator\" if { ssl_c_verify 10 }         http-request return status 403 content-type text\/plain lf-string \"Your certificate has been revoked, please contact the administrator\" if { ssl_c_verify 23 }         http-request use-service prometheus-exporter if { path_beg \/haproxy-exporter-0835n-rm05v-g1nry-r8h-h7dn-gu8v\/ } # exporter haproxy, \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f prometheus ( \/path_beg\/metrics )          use_backend node-exporter if { path_beg -i \/node-exporter-4umx-2nf46x3-qghy-7b3o-zxca-jte\/ } # exporter \u0441\u0435\u0440\u0432\u0435\u0440\u0430 backend node-exporter         mode http         http-request replace-path \/node-exporter-4umx-2nf46x3-qghy-7b3o-zxca-jte(\/)?(.*) \/\\2         server s1 127.0.0.1:9100 frontend f_stats         bind abns@stats.sock         stats enable         stats uri \/stats         stats realm Haproxy\\ Statistics         stats refresh 10s         stats show-legends         stats hide-version         stats show-modules backend stats         mode http         http-request replace-path \/haproxy(\/)?(.*) \/\\2         server s1 abns@stats.sock #------------------------------------------ frontend f_https_reality         bind \/var\/lib\/haproxy\/fakehttps1.sock accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 strict-sni mode 660 user haproxy group haproxy ssl-min-ver TLSv1.3         http-request reject if { req.hdr(user-agent) -m sub evil }         acl url_discovery path \/.well-known\/caldav \/.well-known\/carddav         http-request redirect location \/remote.php\/dav\/ code 301 if url_discovery         http-request deny if { path -m sub \/. }         stick-table type ip size 100k expire 2m store http_req_rate(10s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 240 }         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-response set-header Strict-Transport-Security \"max-age=16000000;\" # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/ } #        default_backend nextcloud #------- BACKEND -------------------------- #[ TCP Passthrough backend tcp-ssh # \u0411\u0435\u043a\u0435\u043d\u0434 \u0434\u043b\u044f SSH         mode tcp         option http-keep-alive         timeout http-keep-alive 30s         server ssh 127.0.0.1:22 check port 22  #backend tcp_to_ocserv #  #        mode tcp #        server oc 127.0.0.1:48658 check port 48658 send-proxy  backend tcp_to_https #          mode tcp         server s1 abns@frontendhttps.sock send-proxy-v2-ssl-cn tfo check          retry-on conn-failure empty-response response-timeout  backend tcp_to_reality          mode tcp         server reality1 \/x-ui\/reality1.sock send-proxy tfo check         retry-on conn-failure empty-response response-timeout  backend tcp_to_mtls         mode tcp         server mtls abns@frontendmtlsadm.sock send-proxy-v2-ssl-cn tfo check         retry-on conn-failure empty-response response-timeout  backend tcp_to_metrics         mode tcp         server metrics abns@metricshttps.sock send-proxy-v2 tfo check         retry-on conn-failure empty-response response-timeout  backend http_3xui # \u0410\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c 3X-UI         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         server 3xui 127.0.0.1:49004 check port 49004  backend http_3xui_sub # \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 3\u0445         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         server 3xsub 127.0.0.1:49007 check port 49007  backend xhttp # XHTTP: Beyond REALITY         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         retry-on conn-failure empty-response response-timeout         server xhttp1 \/x-ui\/xhttp1.sock send-proxy tfo check  backend http_adh # DOH AdGuardHome         mode http         option forwardfor if-none         http-request add-header X-Real-Ip %[src]         http-request set-header Host %[req.hdr(Host)]         http-request set-header X-Forwarded-For %[src]         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request replace-path \/secretpathdns(\/)?(.*) \/\\2         server dns 127.0.0.1:49005 check port 49005  #backend http_site1 # Apache2 #        mode http #        option httpchk #        http-check expect status 200 #        option forwardfor if-none #        http-request add-header X-Real-Ip %[src] #        http-request set-header Host %[req.hdr(Host)] #        http-request set-header X-Forwarded-For %[src] #        http-request set-header X-Forwarded-Host %[req.hdr(host)] #        http-request set-header X-Forwarded-Proto https if { ssl_fc } #        server ap2 127.0.0.1:8080 check  backend nextcloud #         mode http         option forwardfor         http-request set-header X-Forwarded-Proto https if { ssl_fc }         http-request set-header X-Forwarded-Proto http if !{ ssl_fc }         http-request set-header X-Forwarded-Host %[req.hdr(host)]         http-request set-header X-Forwarded-For %[src]         http-request add-header X-Real-Ip %[src]         http-response set-header Strict-Transport-Security max-age=157680000;         server nextcloud 127.0.0.1:49009 #check port 49009  # --- IP List ------------------------------- # Range 48658\u201448999 - TCP \/\/ 49001\u201449100 - http \u0441\u0435\u0440\u0432\u0438\u0441\u044b \/\/ 49101-49150 - WS <\/code><\/pre>\n<\/div>\n<\/details>\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\/904038\/\"> https:\/\/habr.com\/ru\/articles\/904038\/<\/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<details class=\"spoiler\">\n<summary>\u0422\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0442\u0435\u043c\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 VLESS+TLS VLESS-REALITY<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u0440\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e REALITY \u043c\u0435\u0442\u043e\u0434\u043e\u043c steal-oneself(\u0443\u043a\u0440\u0430\u0434\u0438 \u0441\u0435\u0431\u044f) \u0438 \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u044f\u0435\u0442 \u0438\u0445. \u041f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442 <a rel=\"noopener noreferrer nofollow\">1<\/a> <a rel=\"noopener noreferrer nofollow\">2<\/a> <a rel=\"noopener noreferrer nofollow\">3<\/a>. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 unix socket \u0432\u0437\u0430\u043c\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0440\u0442\u043e\u0432, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043d\u0435\u043b\u044c 3X-UI \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0435\u0437 \u0434\u043e\u043a\u0435\u0440\u0430 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f xray, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443. \u0422\u0430\u043a \u0436\u0435 \u0434\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 Haproxy \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f ocserv \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438. <\/p>\n<\/div>\n<\/details>\n<p>\u0412\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u041f\u041e Ubuntu 24.04 LTS \u0438 Haproxy 2.8 \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0432\u044b\u0448\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0432\u0435\u0440\u0441\u0438\u044f XCA 2.8, \u043d\u0430 2.9 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Haproxy \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u044b\u0434\u0430\u0447\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 Haproxy \u0447\u0435\u0440\u0435\u0437 acme.sh, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0431\u0430\u0437\u043e\u0432\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c Apache2 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u043a\u0441\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0423\u0426, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c mTLS, \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440 Prometheus \u0432 Haproxy. <\/p>\n<h2>\u0427\u0430\u0441\u0442\u044c 1. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b LE<\/h2>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044e \u043e\u0442 root \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>sudo su<\/code><br \/>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443:<br \/><code>apt update &amp;&amp; apt upgrade -y<\/code><br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u041f\u041e:<br \/><code>apt install -y haproxy htop socat netcat-traditional apache2<\/code><br \/>\u041f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 80 \u043f\u043e\u0440\u0442 apache2 \u043d\u0430 8080 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0438 SSL:<br \/>\u041e\u0442\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 <code>nano \/etc\/apache2\/ports.conf<\/code> \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u0432\u0438\u0434\u0443 \u043a\u0430\u043a \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435<\/p>\n<pre><code>Listen 8080  #&lt;IfModule ssl_module&gt; #Listen 443 #&lt;\/IfModule&gt;  #&lt;IfModule mod_gnutls.c&gt; #Listen 443 #&lt;\/IfModule&gt;<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c apache2 <code>systemctl restart apache2<\/code><\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c acme.sh \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432. <br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f acme:<br \/><code>adduser --system --disabled-password --disabled-login --home \/var\/lib\/acme --quiet --force-badname --group acme<\/code><br \/>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 haproxy:<br \/><code>adduser acme haproxy<\/code><br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432 acme:<br \/><code>mkdir \/usr\/local\/share\/acme.sh\/<\/code><br \/>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 tmp \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c acme.sh \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<br \/><code>cd \/tmp\/ &amp;&amp; git clone https:\/\/github.com\/acmesh-official\/acme.sh.git &amp;&amp; cd acme.sh\/<\/code><br \/>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c acme.sh \u0431\u0435\u0437 cron \u0432 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u043d\u0435\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e:<br \/><code>.\/acme.sh --install --no-cron --no-profile --home \/usr\/local\/share\/acme.sh<\/code><br \/>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430: <br \/><code>ln -s \/usr\/local\/share\/acme.sh\/acme.sh \/usr\/local\/bin\/<\/code><br \/>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e acme.sh: <br \/><code>chmod 755 \/usr\/local\/share\/acme.sh\/<\/code><br \/>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432:<br \/><code>mkdir \/etc\/haproxy\/certs<\/code><br \/>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430:<br \/><code>chown haproxy:haproxy \/etc\/haproxy\/certs<\/code><br \/>\u0412\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u0430\u0432\u0430:<br \/><code>chmod 770 \/etc\/haproxy\/certs<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 acme.sh, \u0434\u0430\u043b\u0435\u0435 \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <em>acme<\/em>:<br \/><code>sudo -u acme -s<\/code><br \/><code>acme.sh --register-account --server letsencrypt -m example@mail.com<\/code><br \/>\u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0423\u0426 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e ZeroSSL \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 RU:<br \/><code>acme.sh --set-default-ca --server letsencrypt<\/code><br \/>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c <code>acme.sh --update-account <\/code><br \/>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 ACCOUNT_THUMBPRINT \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Haproxy.<br \/>\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>exit<\/code><\/p>\n<p>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Haproxy<br \/>\u0421\u043e\u0442\u0440\u0435\u043c \u0438\u043c\u0435\u044e\u0449\u0443\u044e\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>&gt; \/etc\/haproxy\/haproxy.cfg<\/code><br \/>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b <code>nano \/etc\/haproxy\/haproxy.cfg<\/code><br \/>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0435\u043a\u0446\u0438\u044e Global, \u0432 \u0437\u0430\u043c\u0435\u043d &#171;*<em>ACCOUNT_THUMBPRINT*&#187;<\/em> \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 <em>acme.sh &#8212;update-account, <\/em>\u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0430\u043c\u0438, \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e tls1.2 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c tls1.3<\/p>\n<pre><code>global         log \/dev\/log    local0         log \/dev\/log    local1 notice         chroot \/var\/lib\/haproxy         stats socket \/var\/run\/haproxy\/admin.sock level admin mode 660         setenv ACCOUNT_THUMBPRINT '*ACCOUNT_THUMBPRINT*' # \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 acme         stats timeout 30s         user    haproxy         group   haproxy         daemon     # https:\/\/ssl-config.mozilla.org\/     # \u0423\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438 ( Intermediate ) Supports Firefox 27, Android 4.4.2, Chrome 31, Edge, IE 11 on Windows 7, Java 8u31, OpenSSL 1.0.1, Opera 20, Safari 9         ssl-default-bind-curves X25519:prime256v1:secp384r1         ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256         ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.2 no-tls-tickets          ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305         ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256         ssl-default-server-options ssl-min-ver TLSv1.2 no-tls-tickets      # TLS 1.3 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0431\u0435\u0437 \u043e\u0442\u043a\u0430\u0442\u0430 \u043a TLS 1.2  ( Modern ) Supports Firefox 63, Android 10.0, Chrome 70, Edge 75, Java 11, OpenSSL 1.1.1, Opera 57, Safari 12.1 #        ssl-default-bind-curves X25519:prime256v1:secp384r1 #        ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 #        ssl-default-bind-options prefer-client-ciphers ssl-min-ver TLSv1.3 no-tls-tickets  #        ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 #        ssl-default-server-options ssl-min-ver TLSv1.3 no-tls-tickets          ssl-dh-param-file \/etc\/haproxy\/dh4096.pem # openssl dhparam -out \/etc\/haproxy\/dh4096.pem 4096 #        tune.ssl.default-dh-param 2048       # \u0422\u044e\u043d\u0438\u043d\u0433 http\/2         tune.h2.initial-window-size 536870912 # \u0423\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430 \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.         tune.h2.fe.max-concurrent-streams 512 # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.         tune.h2.be.max-concurrent-streams 512 # \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043a\u043e\u043b-\u0432\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439. <\/code><\/pre>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c DH \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439: <code>openssl dhparam -out \/etc\/haproxy\/dh4096.pem<\/code><\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0435\u043a\u0446\u0438\u0438 defaults \u0438 resolvers \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d \u043d\u0430 backend&#8217;\u0435<\/p>\n<pre><code>defaults        log global        mode http        option httplog        option dontlognull        timeout connect 40s        timeout client  1m        timeout server  1m        timeout tunnel 1h        timeout http-request 30s        errorfile 400 \/etc\/haproxy\/errors\/400.http        errorfile 403 \/etc\/haproxy\/errors\/403.http        errorfile 408 \/etc\/haproxy\/errors\/408.http        errorfile 500 \/etc\/haproxy\/errors\/500.http        errorfile 502 \/etc\/haproxy\/errors\/502.http        errorfile 503 \/etc\/haproxy\/errors\/503.http        errorfile 504 \/etc\/haproxy\/errors\/504.http  resolvers dnsserver         nameserver ns1 127.0.0.1:53         parse-resolv-conf         resolve_retries       3         timeout resolve       1s         timeout retry         1s         hold other           30s         hold refused         30s         hold nx              30s         hold timeout         30s         hold valid           10s         hold obsolete        30s<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c http \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 (\u043f\u043e\u0440\u0442 80)<\/p>\n<pre><code>frontend f_http         bind *:80         bind [::]:80         mode http      # \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u043c \u043d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0435 \u044e\u0437\u0435\u0440 \u0430\u0433\u0435\u043d\u0442\u044b         http-request reject if { req.hdr(user-agent) -m len le 32 }         http-request reject if { req.hdr(user-agent) -m sub evil }      # \u043e\u0442\u0432\u0435\u0442\u0438\u043c \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 ACME         http-request return status 200 content-type text\/plain lf-string \"%[path,field(-1,\/)].${ACCOUNT_THUMBPRINT}\\n\" if { path_beg '\/.well-known\/acme-challenge\/'}         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-request redirect scheme https code 301 unless { ssl_fc }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c TCP \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043d\u0430 443 \u043f\u043e\u0440\u0442\u0443 \u0434\u043b\u044f SSL Passthrough, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c SSH \u043d\u0430 443 \u043f\u043e\u0440\u0442\u0443.<\/p>\n<pre><code>frontend f_tcp         bind *:443    # ipv4 SSL Passthrough         bind [::]:443 # ipv6 SSL Passthrough         mode tcp         option tcplog         tcp-request inspect-delay 3s      # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432         stick-table type ip size 1m expire 10s store conn_cur         tcp-request session track-sc0 src         tcp-request session reject if { sc_conn_cur(0) gt 240 }         tcp-request content capture req.ssl_sni len 10         tcp-request content accept if { req_ssl_hello_type 1 } or !{ req_ssl_hello_type 1 }      # \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f          use_backend tcp-ssh if !{ req.ssl_hello_type 1 } { payload(0,7) -m bin 5353482d322e30 } or !{ req.ssl_hello_type 1 } { req.len 0 } #use_backend tcp-ssh if !{ req.ssl_hello_type 1 } { req.len 0 }          use_backend tcp_to_https if { req.ssl_sni -i one.example.ru } <\/code><\/pre>\n<p> \u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c https \u0444\u0440\u043e\u043d\u0442\u0435\u0434 <\/p>\n<pre><code>frontend f_https #          bind abns@frontendhttps.sock accept-proxy ssl crt \/etc\/haproxy\/certs\/ alpn h2,http\/1.1 strict-sni tfo         http-request reject if { req.hdr(user-agent) -m sub evil }         http-request deny if { path -m sub \/. } # \u0437\u0430\u043f\u0440\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c         http-response set-header X-Content-Type-Options nosniff         http-response set-header X-XSS-Protection 1;mode=block         http-response set-header X-Frame-Options SAMEORIGIN         http-after-response set-header Strict-Transport-Security \"max-age=16000000; includeSubDomains;\" # \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c HSTS         stick-table type ip size 100k expire 5m store http_req_rate(10s)         http-request track-sc0 src         http-request deny deny_status 429 if { sc_http_req_rate(0) gt 300 }         http-request return status 200 content-type text\/plain lf-string \"Status 200 OK! Your IP %[src].\" if { path \/https-status-443 }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u043f\u0440\u0430\u0432\u043a\u0430 *_sni<\/summary>\n<div class=\"spoiler__content\">\n<p>req.ssl_sni &#8212; \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a SNI \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 SSL-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u0438  \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 \u0431\u0435\u043a\u0435\u043d\u0434.<br \/>ssl_fc_sni &#8212; \u041f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 SSL-\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0446\u0438\u044e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u0430 http \u0431\u0435\u043a\u0435\u043d\u0434\u044b.<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f backend \u0441\u0435\u043a\u0446\u0438\u0438 <\/p>\n<pre><code>backend tcp-ssh # \u0411\u0435\u043a\u0435\u043d\u0434 \u0434\u043b\u044f SSH         mode tcp         option http-keep-alive<\/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-457875","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/457875","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=457875"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/457875\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=457875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=457875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=457875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}