Gitlab CE throws an error and Web IDE hangs behind nginx reverse pxy (jwilder)

1.2k views Asked by At

I'm new here.

I have a strange error with gitlab CE (Docker) behind a reverse proxy (Docker/nginx-letsencrypt by jwilder), the same Docker Image runs without any error when the image ports 80 & 443 are mapped directly to the hosts ports. The http call to the web-ide is functional. The same image behind the proxy, where VIRTUAL_PORT=80 is set for gitlab, and 443 + 80 exposed via proxy). Everything works as expected just the web-ide does not load.

Don't understand why gitlab web ide without proxy ssl works with unsecure http? Running gitlab with http only is not an option ;-)

The error output from Chrome:

vue-resource.esm.js:1086 Mixed Content: The page at 'https://lab.flockcode.com/-/ide/project/flockcode/flockcode_homepage/edit/master/.gitlab-ci.yml' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://lab.flockcode.com/flockcode/flockcode_homepage/files/master?format=json'. This request has been blocked; the content must be served over HTTPS.
(anonymous) @ vue-resource.esm.js:1086
r @ vue-resource.esm.js:196
X @ vue-resource.esm.js:1032
Q @ vue-resource.esm.js:1190
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
V @ vue-resource.esm.js:990
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
K @ vue-resource.esm.js:1004
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
z @ vue-resource.esm.js:977
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
U @ vue-resource.esm.js:880
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
H @ vue-resource.esm.js:865
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
G @ vue-resource.esm.js:1024
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
q @ vue-resource.esm.js:846
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
(anonymous) @ vue_resource_interceptor.js:13
c @ vue-resource.esm.js:1147
l @ vue-resource.esm.js:1173
(anonymous) @ vue_resource_interceptor.js:24
c @ vue-resource.esm.js:1147
(anonymous) @ vue-resource.esm.js:1176
r @ vue-resource.esm.js:196
t @ vue-resource.esm.js:1140
oe @ vue-resource.esm.js:1397
oe.(anonymous function) @ vue-resource.esm.js:1428
getFiles @ index.js:72
(anonymous) @ tree.js:59
Rn @ tree.js:53
(anonymous) @ vuex.esm.js:704
P.dispatch @ vuex.esm.js:426
P.dispatch @ vuex.esm.js:332
(anonymous) @ ide_router.js:72
Promise.then (async)
(anonymous) @ ide_router.js:62
p @ vue-router.esm.js:1943
r @ vue-router.esm.js:1717
ue @ vue-router.esm.js:1725
nn.confirmTransition @ vue-router.esm.js:1972
nn.transitionTo @ vue-router.esm.js:1874
sn.init @ vue-router.esm.js:2494
beforeCreate @ vue-router.esm.js:540
Re @ vue.esm.js:2895
e._init @ vue.esm.js:4556
At @ vue.esm.js:4659
(anonymous) @ index.js:10
./ide/index.js @ index.js:22
r @ bootstrap cc923a667f9c8788713a:54
window.webpackJsonp @ bootstrap cc923a667f9c8788713a:25
(anonymous) @ ide.436113d38b71e60d098b.bundle.js:1
.gitlab-ci.yml:1 Uncaught (in promise) je {url: "http://lab.flockcode.com/flockcode/flockcode_homepage/files/master?format=json", ok: false, status: 0, statusText: "", headers: {…}, …}

As I dont know where to start and I tried all sorts of /etc/gitlab/gitlab.rb settings (including uncomment the X header section with no effect)a and the container needs quite a while to restart I'm asking kindly for help. thx in advance.

1

There are 1 answers

0
Jaesung Jeong On

Maybe same problem with me.

  • Reverse Proxy (nginx)
    • w/ Letsencrypt certificate
  • Gitlab-ce docker container

At first, I've set external_url with 'HTTP' then All are ok except Web IDE

https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl

By default NGINX will auto-detect whether to use SSL if external_url contains https://. If you are running GitLab behind a reverse proxy, you may wish to terminate SSL at another proxy server or load balancer. To do this, be sure the external_url contains https:// and apply the following configuration to gitlab.rb:

So, I changed http -> https in external_url, and 'listen_https' to false

external_url 'https://gitlab.example.com'
nginx['listen_https'] = false

Then all are OK to me.

May help to you

http://blog.hangadac.com