将docker存储库配置为artifactory中的子域

时间:2016-08-30 22:21:02

标签: ssl nginx docker subdomain artifactory

我们正在尝试在artifactory版本4.11.1中设置一个docker存储库,以下是设置

-- Created a local docker repo - docker-local
-- Created a virtual dokcer repo - docker-virtual
-- Created a remote docker repo - docker-hub
-- Configured docker-local to be the default deployment repo

我们正在使用支持reverse-proxy.company.com和docker-virtual.reverse-proxy.company.com的多域证书

问题是 是否应将nginx配置设置为以下

server {
listen 80;
listen 443;
server_name docker-virtual.reverse-proxy.company.com reverse-proxy.company.com;
 ..... other confug

}

通过此设置,我希望客户端连接到虚拟仓库

docker push docker-virtual.reverse-proxy.company.com/<my-image>

这是一个有效的设置吗? 请注意,我们没有通配符证书,它不是一个选项。 多域证书是否也需要支持默认部署目录?

1 个答案:

答案 0 :(得分:3)

So you can do it that way by having multiple servername statements instead of the wildcard, and then using our wild-card rewrite rule as-is as you suggested. There is no need to support anything other than the docker-virtual.reverse-proxy.company.com and the reverse-proxy.company.com as the forward from docker-virtual to the local is internal to artifactory.

You could also have separate server statements, which would make it easier to have single domain certs separately. The docker one would then be:

server {
listen 443;  //docker is ssl only
server_name docker-virtual.reverse-proxy.company.com;
 ..... other confug

}