Ubuntu 20.04
Sponsored Link

HAProxy : SSL/TLS の設定2020/09/04

 
HAProxy サーバーの SSL/TLS の設定です。
当例では、クライント - HAproxy サーバー間の通信が SSL/TLS 対応になります。
(HAproxy - バックエンド間は通常通信とする)
当例では前項で例示した以下のような環境をベースに設定します
-----------+---------------------------+--------------------------+------------
           |                           |                          |
           |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 の設定です。
証明書とキーをまとめておく

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

root@dlp:/etc/letsencrypt/live/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] 任意のクライアントからフロントエンドサーバーへ HTTPS アクセスして動作を確認してください。
関連コンテンツ