三、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