同一域中两台不同机器上的两个网络服务器

时间:2021-03-02 17:29:13

标签: apache subdomain

假设我有一个网站 例子.com 我有 2 台服务器,都运行 apache2。 在 server1 上,我有一个 apache2 Web 服务器,配置了端口 443,可通过 https://example.com 我有另一个 Web 服务器在端口 3456 上运行,配置了反向代理和别名,可通过 https://site1.example.com 访问 下一个站点的配置如下

        <VirtualHost *:443>
            ServerAdmin webmaster@localhost
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined

            ServerName site1.example.com

            ProxyPass / http://localhost:3456/
            ProxyPassReverse / http://localhost:3456/

            Include /etc/letsencrypt/options-ssl-apache.conf

            ServerAlias site1.example.com
            SSLCertificateFile /etc/letsencrypt/live/site1.example.com/fullchain.pem
            SSLCertificateKeyFile /etc/letsencrypt/live/site1.example.com/privkey.pem
    </VirtualHost>

site1 工作正常。 最后,我在 server2 端口 80 上运行了第三个 Web 服务器。我想使用 https://site2.example.com 访问它,这样做的正确方法是什么?

0 个答案:

没有答案
相关问题