Hello !
Thank you for your answer.
Here is NGINX configuration :
server {
listen 443 ssl;
server_name <GITLAB-HOST>;
ssl_certificate /etc/nginx/certs/mycert.crt;
ssl_certificate_key /etc/nginx/certs/mykey.key;
ssl_session_cache shared:SSL:1m;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log debug;
location / {
proxy_set_header Host $http_host;
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_intercept_errors off;
proxy_http_version 1.1;
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 https://<PROXY-IP>:<PROXY-PORT>;
}
}
And here is the .gitconfig file from a client :
[http]
sslCAInfo = <path-to-truststore>
[http "https://<GITLAB-HOST>"]
proxy = https://<NGINX-HOST-IP>:443
sslCAInfo = <path-to-truststore>
Here is the git command that I perform on the client and the result :
git clone https://<LOGIN>@<GITLAB-HOST>/myrepo.git
Cloning into 'myrepo'...
fatal: unable to access 'https://<GITLAB-HOST>/myrepo.git/': Failed connect to <GITLAB-HOST>:443; Connection timed out
Here is the version of git CLI on the client :
git-1.8.3.1-23.el7_8.x86_64
And my version of NGINX on the nginx host :
# nginx -v
nginx version: nginx/1.20.2
I tried something else in my ~/.gitconfig file. I kept only one http section :
[http]
sslCAInfo = <truststore-path>
proxy = https://<NGINX-HOST-IP>:443
But now, I have a 400 http error when I execute the git command :
git clone https://<LOGIN>@<GITLAB-HOST>/myrepo.git
Cloning into 'myrepo'...
fatal: unable to access 'https://<GITLAB-HOST>/myrepo.git/': Received HTTP code 400 from proxy after CONNECT
And I can see this in NGINX logs :
2022/11/08 10:25:09 [info] 24032#24032: *1 client sent invalid request while reading client request line, client: <CLIENT-IP>, server: <GITLAB-HOST>, request: "CONNECT <GITLAB-HOST>:443 HTTP/1.1"
Thank you in advance !