I migrated my Gitlab to a new domain. I'd like to redirect all HTTP requests from the old URL to the new one. Both domains currently point to the same server (using A
DNS records).
I use Gitlab Omnibus package, with the bundled nginx install. How to do this?
First, create
/etc/nginx/conf.d/redirect.conf
:(if the
/etc/nginx/conf.d/
path does not exist, go ahead and create it)Now edit the configuration file at
/etc/gitlab/gitlab.rb
to add the following line:Finally, run
gitlab-ctl reconfigure
to rewrite the nginx configuration and restart nginx.