我正在尝试配置与作为docker一部分的集成letnecrypt一起使用的docker GitLab CE(最新)实例,以便在Apache 2.4代理的子域下将其认证为HTTPS。< / p>
我希望它通过Apache的原因是,在这种环境下,有一个正在运行的网页声明了端口80、443等。因此,为了让我拥有两者,我将docker的端口映射到了443:444和80:3000。
并且通过apache的虚拟主机命名,我具有以下配置:
<VirtualHost domain.com:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost gitlab.domain.com:80>
ServerAdmin webmaster@localhost.com
ProxyPreserveHost On
ProxyPass "/" "http://public-ip:3000/"
ProxyPassReverse "/" "http://public-ip:3000/"
ServerName gitlab.domain.com
</VirtualHost>
<VirtualHost gitlab.domain.com:443>
ServerAdmin webmaster@localhost.com
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
ProxyPreserveHost On
ProxyPass "/" "http://public-ip:3000/"
ProxyPassReverse "/" "http://public-ip:3000/"
ServerName gitlab.domain.com
</VirtualHost>
您认为最好的方法是什么?