I am running gitlab-ce on a server behind a router/firewall and trying to access externally it via a non standard port
As I already have another machine running on https port 443 I want to run the gitlab instance on a different https port and using letsencrypt certificates generated elsewhere and copied across.
Gitlab runs on a local IP 10.0.0.220 No firewall local setup - only currently on router (trying to isolate issues)
I have an external hostname gitlab.mydomain.com pointing to the static IP on the router
The router is set to port forward external.ip:4443 -> 10.0.0.220:4443
As per the docs I set (everything else is default):
external_url āhttps://gitlab.mydomain.com:4443ā
I can connect on the local IP https://10.0.0.220:4443 This shows the letsencrypt certificate is loaded.
(Browser shows: āThis server could not prove that it is 10.0.0.220; its security certificate is from mydomain.comā)
A couple of issues.
I cannot connect from an external site to https://gitlab.mydomain.com:4443
I can see the router passing packets from external to the internal IP but get this in Firefox:
In the bottom bar it says 'performing TLS handshake and then
āSecure Connection Failed
The connection to the server was reset while the page was loading.
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.ā
Unfortunately to compound this issue I can see the nginx standard access_log which shows data when accessing from the local IP, but I canāt see ANY nginx logging at all for external sites, so it is proving impossible to track down where the issue lies.
If I add this to gitlab.rb
nginx[āredirect_http_to_httpsā] = true
I can see the connection to http://10.0.0.220 try to upgrade to https://gitlab.mydomain.com:4443 but it then fails as above.
root@gitlab:~# netstat -tan | grep 4443
tcp 0 0 0.0.0.0:4443 0.0.0.0:* LISTEN
tcp 0 0 10.0.0.220:4443 192.168.10.20:39920 ESTABLISHED
Iāve hunted though here for answers but still come up stuck
https://docs.gitlab.com/omnibus/settings/nginx.html
Tried the following in gitlab.rb
This should be able to be modified from the template:
http {
log_format gitlab_access ā<%= @gitlab_access_log_format %>ā;
but seems it is ignored - I added the $ssl bits, but it never gets expanded to nginx.conf
nginx[āgitlab_access_log_formatā] = ā$remote_addr - $remote_user [$time_local] $ssl_protocol/$ssl_cipher ā$request_method $filtered_request_uri $server_protocolā $status $body_bytes_sent ā$filtered_http_refererā ā$http_user_agentāā
Iāve seen some comments about adding the external IP to /etc/hosts ?
Current hosts file is:
root@gitlab:~# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 gitlab.mydomain.com gitlab
Any help or suggestions gratefully received. Iām sure the solution is dead simple but itās like banging my head agains a wall !!