Welcome! Log In Create A New Profile

Advanced

Nginx reverse proxy with gitlab docker container backend

Posted by brx 
brx
Nginx reverse proxy with gitlab docker container backend
March 22, 2017 08:20AM
Want to access my gitlab instance (docker container)

running on internal server: http://192.168.1.8:30000,
through nginx reverse proxy via external url

https://mydomain/git/

GitLab instance works fine and without any problem from internal

http://192.168.1.8:30000

Current "problem" behaviour is like:

When I access

https://mydomain/git/

The url is directed to

https://mydomain/users/sign_in.

The right url should be (for my unterstanding)

https://mydomain/git/users/sign_in.

There must be something incorrect with my reverse proxy config (see below):

Nginx reverse proxy config:

location ^~ /git/ {

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;

proxy_pass http://192.168.1.8:30000;
proxy_read_timeout 90;

proxy_redirect http://192.168.1.8:30000 https://mydomain/git;
}

I sounds like my proxy_redirect ist not working the right way.

Nginx test output says ok:

sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Nginx start without any errors.

Could anybody give me a hint, what's wrong in my reverse proxy configuration.

Thanks in advance brx
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready