My Gitlab redirect from external domain to my local IP

Hi!

First, I am sorry for my poor english, I speak very few english xD.

Well, now the problem. I install and configure my Gitlab and I put the external url “http://git.e418-2.ga”. It works but has a problem, when I go to this address it redirects to the local IP of the machine and from Internet is not good… I try the other machine with an Apache2 and its works right, not redirect in this case. I supose I have something wrong. Can you help me, please? Thank you!

NOTE: In some CMSs like Wordpress or other similar software (ERPs, etc.), there is an option with the default root uri address to use. If it could be the mistake where can I find this option?

Sure, I could help you, though before giving you any answer I would request you to take output of the below commands and post it here for better understanding of your problem.

These commands can be run on production environment: (run as root)

to check process running or not:
ps -ef | grep -n gitlab

to check hostname of machine:
hostname

to check DNS on your machine and the machines you are testing your URL:
nslookup git.e418-2.ga

to check the route:
traceroute git.e418-2.ga

to verify hostname of machine:
cat /etc/hosts

to check url for GitLab:
cat /gitlab/gitlab.rb | grep external_url

to check port is open for GitLab or not:
netstat -tlpn

to check selinux status:
sestatus

to check any firewall enabled or not:
iptables --list

Let me know if you have any issue on executing above commands.

1 Like

Hello! Many thanks for your answer. I can’t connect before. Sorry. I found the problem. The configuration of the Gitlab that I had was right, the problem was in the redirect that I suspect has Gitlab because I have a Nginx in the main router of my network with a reverse proxy with domain routes, between there, “git.e418-2.ga”. I test the redirection with a simple HTML file against Apache2 and It’s correct, but against Gitlab, its redirect. Gitlab, in this case, need add a header with the original domain query and it will be redirected to the same address, if not, it will redirect to the local IP address with the main router Nginx.

Many thanks again poojagupta! :smiley: