I install nginx in one container then install gitlab in another container;
I also create a custom network bridge with them;
I config reverse proxy but it dosen’t work
is there any document I can read? or anybody help me?
docker run -p 80:80 --name nginx -v /root/docker/nginx/html:/usr/share/nginx/html -v /root/docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
docker run -d -h gitlab -p 8100:80 -p 8200:443 -p 8300:22 -v /docker/gitlab/config:/etc/gitlab -v /docker/gitlab/logs:/var/log/gitlab -v /docker/gitlab/data:/var/opt/gitlab --name gitlab gitlab/gitlab-ce:latest
####Gitlab
server {
listen 80;
server_name gitlab.localserver.com;
charset utf-8;
#access_log logs/host.access.log main;
#对 / 所有做负载均衡+反向代理
location / {
# root /apps/oaapp;
# index index.jsp index.html index.htm;
proxy_pass http://gitlab:8100;
#proxy_pass http://nexus:8081;
proxy_redirect off;
# 后端的Web服务器可以通过X-Forwarded-For获取用户真实IP
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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
}
}