CentOS 8
Sponsored Link

HAProxy : SSL/TLS の設定2019/11/08

 
HAProxy サーバーの SSL/TLS の設定です。
クライント <=> HAproxy サーバー間の通信が SSL 対応になります。
-----------+---------------------------+--------------------------+------------
           |                           |                          |
           |10.0.0.30                  |10.0.0.51                 |10.0.0.52
+----------+-----------+   +-----------+----------+   +-----------+----------+
|   [ dlp.srv.world ]  |   | [ node01.srv.world ] |   | [ node02.srv.world ] |
|        HAProxy       |   |      Web Server#1    |   |      Web Server#2    |
+----------------------+   +----------------------+   +----------------------+

[1]
[2] 前項で例示した HAProxy 基本設定をベースに、SSL/TLS 用の追加設定をします。
# 証明書とキーをまとめておく

[root@dlp ~]#
cd /etc/letsencrypt/live/dlp.srv.world

[root@dlp dlp.srv.world]#
cat fullchain.pem privkey.pem > haproxy.pem

[root@dlp ~]#
[root@dlp ~]#
vi /etc/haproxy/haproxy.cfg
# frontend セクションへ追記 (80 ポートのリスンが不要の場合はコメント化)

frontend http-in
    bind *:80
    bind *:443 ssl crt /etc/letsencrypt/live/dlp.srv.world/haproxy.pem 

[root@dlp ~]#
systemctl restart haproxy

[3] Firewalld を有効にしている場合は、HAProxy が待ち受けるポートの許可が必要です。
[root@dlp ~]#
firewall-cmd --add-service=https --permanent

success
[root@dlp ~]#
firewall-cmd --reload

success
[4] 任意のクライアントコンピューターから HAProxy フロントエンドサーバーへ HTTPS アクセスして動作を確認しておきます。
関連コンテンツ