I know, that this forum might not address reverse proxy configurations, but as many users are probably going to run a similar setup, I wanted to post this question here.
I set up a docker container running gitlab and mapping port 443 -> 443, 0.0.0.0:2222->22, :::2222->22 and 127.0.0.1:8080->80.
With nginx I have set up a reverse proxy:
Config File:
server {
server_name gitlab.<mydomain>;
client_max_body_size 256M;
location / {
proxy_pass http://localhost:8080;
proxy_read_timeout 3600s;
proxy_http_version 1.1;
# Websocket connection
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate ...; # managed by Certbot
ssl_certificate_key ...; # managed by Certbot
include ...; # managed by Certbot
ssl_dhparam ...; # managed by Certbot
}
server {
listen 80;
listen [::]:80;
server_name gitlab.<mydomain>;
if ($host = gitlab.<mydomain>) {
return 301 https://$host$request_uri;
} # managed by Certbot
return 404; # managed by Certbot
}
Now I also want to be able to clone via ssh with the gitlab.<mydomain> address, but still be able to ssh onto my server via the <mydomain> address.
Does anyone of you know a setup/ configuration, which achieves my above described setup?