502 Bad Gateway

前端之家收集整理的这篇文章主要介绍了502 Bad Gateway前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在使用Nginx-proxy将子域连接到不同的docker服务.由于最后一次图像更新,我无法再连接到我的gitlab实例.我不知道Nginx-proxy或gitlab更新是否导致了这个问题.当我尝试连接到gitlab.mydomain.com时,我收到以下错误

>浏览器:502 Bad Gateway. Nginx的/ 1.13.3
> Nginx-proxy日志:

Nginx-proxy_1 | Nginx.1 | 2017/08/14 11:44:10 [错误] 39#39:* 1672 connect()失败(111:连接被拒绝)连接上游,客户端:178.201.120.94,服务器:gitlab.mydomain.com,请求: “GET / HTTP / 2.0”,上游:“https://172.18.0.2:443/”,主持人:“gitlab.mydomain.com”

Nginx-proxy_1 | Nginx.1 | gitlab.mydomain.com 178.201.120.94 – – [14 / Aug / 2017:11:44:10 0000]“GET / HTTP / 2.0”502 575“ – ”“Mozilla / 5.0(Windows NT 10.0; Win64; x64)AppleWebKit /537.36(KHTML,与Gecko一样)Chrome / 60.0.3112.90 Safari / 537.36“

Nginx-proxy_1 | Nginx.1 | 2017/08/14 11:44:11 [错误] 39#39:* 1672 connect()失败(111:连接被拒绝)连接上游,请求: “GET /favicon.ico HTTP / 2.0”,上游:“https://172.18.0.2:443/favicon.ico”,主持人:“gitlab.mydomain.com”,推荐人:“https://gitlab.***.com /”

我的docker-compose文件

version: '2'

services:
   Nginx-proxy:
     image: jwilder/Nginx-proxy
     ports:
     - "80:80"
     - "443:443"
     volumes:
     - /var/local/Nginx/certs:/etc/Nginx/certs
     - /etc/letsencrypt:/etc/letsencrypt
     - /var/run/docker.sock:/tmp/docker.sock:ro

   gitlab:
     image: gitlab/gitlab-ce:latest
     ports:
     - "2222:22"
     hostname: 'gitlab.***.com'
     expose:
     - 443
     - 22
     - 80
     - 25
     environment:
     - "VIRTUAL_HOST=gitlab.***.com,www.gitlab.***.com"
     - "VIRTUAL_PORT=443"
     - "VIRTUAL_PROTO=https"
     volumes:
     - "gitlab-config:/etc/gitlab"
     - "gitlab-log:/var/log/gitlab"
     - "gitlab-data:/var/opt/gitlab"
     - "/etc/letsencrypt:/etc/letsencrypt"

有什么想法吗?谢谢.
编辑:
来自docker的网络设置检查gitlab:

    "NetworkSettings": {
        "Bridge": "","SandBoxID": "...","HairpinMode": false,"LinkLocalIPv6Address": "","LinkLocalIPv6PrefixLen": 0,"Ports": {
            "22/tcp": [
                {
                    "HostIp": "0.0.0.0","HostPort": "2222"
                }
            ],"25/tcp": null,"443/tcp": null,"80/tcp": null
        },"SandBoxKey": "/var/run/docker/netns/...","SecondaryIPAddresses": null,"SecondaryIPv6Addresses": null,"EndpointID": "","Gateway": "","GlobalIPv6Address": "","GlobalIPv6PrefixLen": 0,"IPAddress": "","IPPrefixLen": 0,"IPv6Gateway": "","MacAddress": "","Networks": {
            "docker_default": {
                "IPAMConfig": null,"Links": null,"Aliases": [
                    "abb170528bcc","gitlab"
                ],"NetworkID": "...","EndpointID": "...","Gateway": "172.18.0.1","IPAddress": "172.18.0.2","IPPrefixLen": 16,"MacAddress": "02:42:ac:12:00:02"
            }
        }
    }
最佳答案
这个设置对我有用,也许你可以比较一下,发现,出了什么问题:

https://superuser.com/a/1242682/762931

也许是这样的:
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1307

原文链接:https://www.f2er.com/nginx/434433.html

猜你在找的Nginx相关文章