Restrict Gitlab server from changing direct WAN IP to domain reddit / selfhosted ---------------------------------------------------------------------- ballonnetje · 2023-11-10 13:19 Hey everyone, I have a local server with Gitlab on it. Domain name is attached to that server. I only want users to connect via domain name and error out on a direct IP request. Now, when a user types in my home-IP they will be redirected to the domain what more or less has some of my personal information on it (company details). Now I found some lines in the Nginx config from Gitlab if ($http_host = "") { set $http_host_with_default "git.DOMAIN"; } which shouldnt be editted manually, so I created a line in the gitlab config to add some custom nginx config containing: server { listen 80; listen [::]:80; if ($http_host = "") { return 444; } if ($http_host != "") { return 444; } } Now if I'm correct this would actually return 444 on all cases, but nothing happens. How can I configure Gitlab to NOT redirect? redirect from http to https of course is great, but this IP to domain redirect isn't. Am I missing some configuration here what causes it or am I doing something wrong in the custom config? ---------------------------------------------------------------------- AnonymusChief · 2023-11-16 03:57 I guess you’re trying to access your locally hosted Gitlab. You can try to use a non http or https port, or use a proxy, like Nginx Proxy Manager or Traefik. ---------------------------------------------------------------------- ballonnetje · 2023-11-16 16:50 Thanks. Yes I fixed it by changing the domain and by configuring a nginx server as reverse proxy that's in front of the gitlab nginx server.