I had install GitLab with Docker compose :
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: always
hostname: 'gitlab.example.fr' # i change the hostname
environment:
GITLAB_OMNIBUS_CONFIG: |
# Add any other gitlab.rb configuration here, each on its own line
external_url 'https://gitlab.example.fr'
gitlab_rails['gitlab_shell_ssh_port'] = 2424
letsencrypt['enable'] = false
nginx['listen_https'] = true
nginx['listen_port'] = 443
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/nginx.cer"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/nginx.key"
ports:
- '380:80'
- '3443:443'
- '2424:2424'
volumes:
- '$GITLAB_HOME/certs:/etc/gitlab/ssl'
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
shm_size: '256m'
networks:
- public
- private
I have this Nginx proxy conf on my server to redirect on my container :
server {
listen 80;
server_name gitlab.example.fr;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name gitlab.example.fr;
ssl_certificate /etc/nginx/ssl/ssl_certificate.cer;
ssl_certificate_key /etc/nginx/ssl/private_key.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
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://127.0.0.1:3443;
}
}
i think the problem come to this config, but i don’t know what to do.
the error return when i access to GitLab : 400 Bad Request The plain HTTP request was sent to HTTPS port nginx
Thank in advance for your helping !