I'm trying to make Gitlab work behind Nginx. my configs:
Nginx:
upstream gitlab-workhorse {
server unix:/var/opt/gitlab/gitlab-workhorse/sockets/socket fail_timeout=0;
}
location /gitlab/ {
rewrite ^/gitlab(/.*)$ $1 break;
client_max_body_size 0;
gzip off;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://gitlab-workhorse;
}
/etc/gitlab/gitlab.rb:
external_url "https://myhostname.com/gitlab"
web_server['external_users'] = ['www-data']
nginx['enable'] = false
gitlab_workhorse['enable'] = true
gitlab_workhorse['listen_network'] = "unix"
gitlab_workhorse['listen_addr'] = "/var/opt/gitlab/gitlab-workhorse/sockets/socket"
at request to myhost.com/gitlab/users/sign_in I get "/users/sign_in" not found
if I change in gitlab configuration
external_url "https://myhostname.com/"
(without /gitlab
path in the end) it starts to work but it's always redirects to the / of the server instead of /gitlab