我已经为此配置奋斗了好几天,无论我做什么,我都无法使其完全正常工作.谁能帮我吗??
我正在使用这里描述的解决方案:https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion,它对我所有其他容器都非常有效,但对gitlab而言却不是.使用这种方法,一旦登录了绿色的挂锁,只有gitlab登录页面是完全安全的,并且文本Secure消失并且https告诉我; “您与该站点的连接并不完全安全”.我已经检查了gitlab容器中的日志,它发现ssl证书很好,并且没有给出其他错误或表明有问题的提示.任何人?
文件:start.up
#!/bin/bash
docker run -d
--name ng
-p 80:80
-p 443:443
-v /etc/nginx/conf.d
-v /root/network/nginx/vhost.d:/etc/nginx/vhost.d
-v /root/network/nginx/html:/usr/share/nginx/html
-v /root/network/nginx/certs:/etc/nginx/certs:ro
-e DEFAULT_HOST=domain.com
-e VIRTUAL_PROTO=https
-e VIRTUAL_PORT=443
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
nginx
docker run -d
--name ngg
--volumes-from ng
-v /root/network/nginx/templates:/etc/docker-gen/templates:ro
-v /var/run/docker.sock:/tmp/docker.sock:ro
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen
jwilder/docker-gen
-notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
docker run -d
--name ngl
--volumes-from ng
-v /var/run/docker.sock:/var/run/docker.sock:ro
-v /root/network/nginx/certs:/etc/nginx/certs:rw
jrcs/letsencrypt-nginx-proxy-companion
文件:docker-compose.yml
version: "3"
services:
gitlab:
container_name: gl
image: "gitlab/gitlab-ce:latest"
restart: always
hostname: "gitlab.domain.com"
environment:
GITLAB_OMNIBUS_CONFIG:
external_url "https://gitlab.domain.com"
expose:
- 80
- 443
- 22
volumes:
- "./gitlab/config:/etc/gitlab"
- "./gitlab/logs:/var/log/gitlab"
- "./gitlab/data:/var/opt/gitlab"
- "./nginx/certs:/etc/gitlab/ssl"
environment:
- VIRTUAL_HOST=gitlab.domain.com
- LETSENCRYPT_HOST=gitlab.domain.com
- LETSENCRYPT_EMAIL=info@domain.com
network_mode: "bridge"
我认为您在docker-compose.yml中缺少了nginx配置.
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https","X-Forwarded-Ssl" => "on"
}
以下要点对我有很大帮助!
https://gist.github.com/netdesk/c1db2985b542f9916995139318e5a7ce