relayd.html (1416B)
1 <h1>relayd、httpd、acme-client</h1> 2 <time>2025-07-17</time> 3 4 <h2>はじめに</h2> 5 <p> 6 このサーバーでは<code>httpd</code>により80番ポートと443番ポートを監視して\ 7 ウェブサイトを運用していたが、別のソフトウェアを使ってバーチャルホストを立てたくなった。\ 8 そこで、<code>httpd</code>の手前に<code>relayd</code>を挟んで、\ 9 外から80番、443番ポートへの通信をサブドメインによって振り分けるようにした。\ 10 </p> 11 12 <figure> 13 <figcaption>Before</figcaption> 14 <pre>\ 15 Internet -- tcp/80,443 -- httpd 16 </pre> 17 </figure> 18 <figure> 19 <figcaption>After</figcaption> 20 <pre>\ 21 Internet -- tcp/80,443 -- relayd -- tcp/8080,8443 -- httpd 22 └------ tcp/8081 -- other http server 23 </pre> 24 </figure> 25 26 <h2>httpd.conf</h2> 27 <p> 28 <code>httpd.conf</code>は80番ポートを監視している部分はポート番号を変更するだけでいい。\ 29 443番ポートの方はポート番号の変更に加え、<code>tls</code>の部分を削除する。\ 30 tlsは<code>relayd</code>が行なう。\ 31 </p> 32 33 <h2>acme-client.conf</h2> 34 <p> 35 こちらは<code>full chain certificate</code>のパス<code>relayd</code>が見つけられるように\ 36 変更する。 37 </p> 38 39 <h2>relayd.conf</h2> 40 <p> 41 80番ポートはそのまま8080番に転送する。\ 42 443番ポートはtlsをかませて8443番に転送する。\ 43 </p> 44