How to lock relative_url in GitLab CE Omnibus edition?

I’m using GitLab CE Omnibus 10.7.3.

According to, in order to put GitLab into a relative URL, I just need to modify external_url in /etc/gitlab/gitlab.rb, followed by sudo gitlab-ctl reconfigure and sudo gitlab-ctl restart.

And the following was my gitlab.rb:

external_url ''

After reconfigure and restart, it indeed worked flawlessly.

But things go wrong after a reboot of the machine. I noticed that external_url in gitlab.rb was automatically reverted to whenever the server gets restarted, where is the intranet IP address of the server.

As my intranet server is accessed from external via a port forwarding setting on the gateway, it is understandable the the intranet server will not be able to tell its public domain name, nor would it be able to tell the relative URL that I want to put it under.

So, my questions is, how do I lock down the external_url configuration in gitlab.rb, so that it doesn’t revert to IP address without relative URL upon every server restart? I searched on SO and on Google, but I have not been able to find any lead on locking down the setting. The only thing related I found was about deploying GitLab Omnibus on AWS, but it didn’t talk about locking in the relative URL, either.

Is there anything that I missed on setting GitLab Omnibus up for relative URL?