1

I have problems to config nginx as proxy for gitlab.

I run gitlab with the following port configuration:

sudo docker run --detach \
    --hostname gitlab.myserver.com \
    --publish 8929:80 --publish 2289:22 \
    --name gitlab \
    --restart always \
    --volume /srv/gitlab/config:/etc/gitlab \
    --volume /srv/gitlab/logs:/var/log/gitlab \
    --volume /srv/gitlab/data:/var/opt/gitlab \
    gitlab/gitlab-ce:latest

Now I plan to user nginx as a proxy for multiple docker containers:

docker run --name nginx-proxy -v ./nginx.conf:/etc/nginx/nginx.conf:ro -d nginx

Is the follwoing config enough to make gitlab accessable when browsing gitlab.myserver.com

upstream gitlab.myserver.com {
    server localhost:8929;
}

server {
    gzip_types text/plain text/css application/json application/x-javascript
               text/xml application/xml application/xml+rss text/javascript;

    server_name gitlab.myserver.com;

    location / {
        proxy_pass http://gitlab.myserver.com;
        include /etc/nginx/proxy_params;
    }
}
robert
  • 797
  • 3
  • 9
  • 23

0 Answers0