碧海晴天 - 2026年1月
type: channel
link: https://www.185186.xyz/2026/01/
description: 你若安好便是晴天，你若安不好...
items: apache2 反代 docker

apache2 反代 docker
type: item
date: 2026-01-08T05:34:51+00:00
description: 三、Apache 虚拟主机配置（重点）/etc/apache2/sites-available/app1.conf ServerName a.example.com ProxyPreserveHost On ProxyRequests Off ProxyPass / http://app1:8080/ ProxyPassReverse / http://app1:8080/ ErrorLog ${APACHE_LOG_DIR}/app1_error.log CustomLog ${APACHE_LOG_DIR}/app1_access.log combined /etc/apache2/sites-available/app2.conf ServerName b.example.com ProxyPreserveHost On ProxyRequests Off ProxyPass / http://app2:3000/ ProxyPassReverse / http://app2:3000/ 四、启用站点sudo a2ensite app1.confsudo a2ensite app2.confsudo systemctl reload apache2