I try to setup Nginx Proxy Monitor(NGPM) as a reverse proxy for Gitlab and other websites/services. Gitlab itself is running inside a docker container that has it's own IP address. NGPM is also inside a docker container. Both containers run on an Unraid server (and were installed from the "Apps" which, in this case are prefilled docker templates)

I've tried this:

But this just lead to a 502 Bad Gateway error from Nginx.

Also tried some other things, but most links I find talk about decoupling the nginx from gitlab with an nginx on the same machine pointing to some gitlab stuff.

At this point I am lost to why nothing works, and am just poking around in config files without really knowing what I am doing. I don't even know what to provide you with in order to help me, so please, if you need sth. to help me with my problem I'll gladly attach that.

Edit Logs:
Error log looks like this:

2020/06/24 11:55:54 [error] 2834#2834: *1966 connect() failed (113: Host is unreachable) while connecting to upstream, client:, server: develop.company.com, request: "GET / HTTP/2.0", upstream: "", host: "develop.company.com", referrer: "" 

Access Log like this:

[24/Jun/2020:11:49:56 +0200] - 502 502 - GET https develop.company.com "/" [Client] [Length 166] [Gzip -] [Sent-to] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0" ""   
[24/Jun/2020:11:49:56 +0200] - - 499 - GET https develop.company.com "/favicon.ico" [Client] [Length 0] [Gzip -] [Sent-to] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0" "-"

Note that I changed the client IP for the purpose of uploading here. Since I'm testing it from within the network where proxy and gitlab are located, this is our external IP.

Edit Config:
I tried only with this:
But also this:
nginx['listen_port'] = 80
nginx['listen_https'] = false

I also tried the http variant for external_url.

enter image description here enter image description here
I also tried http with 443, https with 80, but it didn't matter (and also wouldn't have made much sense).

  • Welcome to Server Fault! A 500 error is the webservers way of saying "I have a major problem, but I don't want to talk about it in public". Look at the error log of the server (usually located under /var/log), there will be a clear message saying what's wrong. – Gerald Schneider Jun 24 at 9:43
  • Posting the relevant parts from your configuration could also be helpful. We can't guess. – Gerald Schneider Jun 24 at 9:44
  • I added a bunch of info – EaranMaleasi Jun 24 at 10:19

Bridging the network connection for the docker container in Unraid, instead of giving it it's own IP address, did the trick, the reverse proxy seems to work fine now.

Here all the "Setup" that I needed.
In the gitlab.rb file you need to uncomment/set these values:

nginx['listen_port'] = 80
nginx['listen_https'] = false

Note, that the https:// is necessary here.

The entry in the NGPM:
enter image description here

The Unraid container config:
enter image description here

So yeah. Don't know why this didn't work when Gitlab had it's own IP address, but this works as expected now.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.