gitlab 和 taiga 的反向代理 - docker

Reverse proxy for gitlab and taiga - docker

我正在尝试用 nginx 制作负载均衡器大约 4 个小时,但我不知道如何处理它。

我的计划是:

客户端 -> nginx 负载均衡器 -> gitlab 或 taiga.io

现在我的 nginx 配置:

upstream gitlab {
    server localhost:8081;
}

server {
    listen 80;
    server_name git.localhost.com
    client_max_body_size 300M;
    location / {
        proxy_pass http://localhost:8081/;
        proxy_set_header Host           $host;
        proxy_set_header X-Real-IP      $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
    }
}

Gitlab 在 localhost:8081 上工作很好。 当我转到 git.localhost.com 时,我只看到 502 错误和错误日志:

 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: git.localhost.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "git.localhost.com"

我做错了什么? 我试过这个:Gitlab 5.3 behind nginx reverse proxy 还是不行。

http://localhost:8081(有效)和 nginx 代理您的请求的位置(无效)之间肯定存在一些差异。

目前您的upstream块没有被使用。

proxy_pass 中,尝试将 http://localhost:8081/ 替换为 http://gitlab