[英]503 Service Temporarily Unavailable with gitlab docker and nginx-proxy docker
I've set up the nginx-proxy container which works really great with one of my two docker containers. 我已经设置了nginx-proxy容器 ,它对我的两个docker容器之一非常有用。 Which is just a mini go web server on dev.MY_IP_ADDRESS.com
. 这只是dev.MY_IP_ADDRESS.com
上的迷你go web服务器。
I've set it up for my gitlab docker container as well which runs on MY_IP_ADDRESS.com:10080
but doesn't seem to work with gitlab.MY_IP_ADDRESS.com
我已经为我的gitlab docker容器设置了它,它在MY_IP_ADDRESS.com:10080
上运行,但似乎不适用于gitlab.MY_IP_ADDRESS.com
I've done the same configurations as with my web server, by setting by adding an environment variable: 我通过添加环境变量来设置与我的Web服务器相同的配置:
gitlab:
#other configs here
environment:
- VIRTUAL_HOST=gitlab.MY_IP_ADDERSS.com
#more configs here
The only difference is that I set up my go server and nginx-proxy server in the same docker-compose.yml
and the gitlab one uses a different docker-compose.yml
file. 唯一的区别是我在同一个docker-compose.yml
设置了我的go服务器和nginx-proxy服务器,而gitlab使用了另一个docker-compose.yml
文件。 Unsure if this has anything to do with it. 不确定这是否与它有关。
I've attempted to docker-compose up
each file in a different orders to see if that was an issue. 我试图以不同的顺序docker-compose up
每个文件以查看是否存在问题。
This is what I get when I go on gitlab.MY_IP_ADDRESS.com: 这是我进入gitlab.MY_IP_ADDRESS.com时得到的结果:
503 Service Temporarily Unavailable 503服务暂时不可用
nginx/1.11.8 nginx的/ 1.11.8
Why isn't the reverse proxy for gitlab.MY_IP_ADDERSS.com
working for gitlab? 为什么gitlab.MY_IP_ADDERSS.com
的反向代理gitlab.MY_IP_ADDERSS.com
用于gitlab? Is there a conflict somewhere? 某处有冲突吗? It works fine on MY_IP_ADDRESS.com:10080
它在MY_IP_ADDRESS.com:10080
上运行MY_IP_ADDRESS.com:10080
If any logs are needed or any more information let me know. 如果需要任何日志或任何更多信息让我知道。 Thanks. 谢谢。
I completely forgot about this question, I actually found a solution which worked for me: 我完全忘记了这个问题,我实际上找到了一个对我有用的解决方案:
The problem is that your docker-gen
is not able to find your GitLab and therefore does not generate the Nginx configuration for gitlab.MY_IP_ADDERSS.com
. 问题是您的docker-gen
无法找到您的GitLab,因此不会为gitlab.MY_IP_ADDERSS.com
生成Nginx配置。
To solve this you have three options: 要解决这个问题,您有三种选择:
1.) If you are using the solution with separate containers and launch the docker-gen
container with the -only-exposed
flag this might prevent it from finding GitLab. 1.)如果您使用具有单独容器的解决方案并使用-only-exposed
标志启动docker-gen
容器,这可能会阻止它找到GitLab。 This was the issue in my case which is why I am mentioning it. 这是我案例中的问题,这也是我提到它的原因。
2.) In your case it will probably be because your GitLab container and your Nginx container do not share a common Docker network. 2.)在您的情况下,可能是因为您的GitLab容器和您的Nginx容器不共享共同的Docker网络。 Create one like docker create network nginx-proxy
and add all your containers to it. 创建一个像docker create network nginx-proxy
,并将所有容器添加到它。
3.) Another solution proposed in this issue is to add a line network_mode: bridge
to your GitLab container. 3.) 此问题中提出的另一个解决方案是向您的GitLab容器添加一行network_mode: bridge
。 I did not test this myself. 我自己没有测试过。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.