Proper way to resolve a nginx forward issue

I have a self hosted instance of gitlab, and have an issue with trying to make a forward work correctly.

So the setup currently works when I goto http(s)://fqdn/gitlab, but I get a 404 if I try to goto http(s)://fqdn/

I am not by any means a proficient man when it comes to nginx, but rather good with Apache. I looked up how to do a forward and the section I added to “gitlab-http.conf” does nothing :

server {
listen *:443;
server_name https://fqdn/;
return 301 https://fqdn/gitlab;
}

Any ideas?
Thanks!
Andrew.

AFAIU, the behavior you describe is perfectly normal. There is no page at https://fqdn (thus 404), and 301 says that you must go to https://fqdn/gitlab.

1 Like

I understand that it may be normal, but I would like to setup said forwarding, and my nginx server section addition does not work as I hoped it would. Being a noob with nginx, I was hoping there was SOME way that would suffice. I know how to do this with Apache, but would prefer to stay as “stock” as humanly possible.

Thanks!
Andrew.

Hello, I’m not very clear, but do you want to redirect to http://host/ instead of http://host/gitlab ?, or do you want both to work?
Did you check external_url in the file /etc/gitlab/gitlab.rb?

1 Like

I would like the //host to work as a redirect to the already (and apparently normal) functioning //host/gitlab

Thanks!

::edit1::
Oh forgot – the external url I did play with but I didnt see a change. As it sits right now its set to //host
Thanks.

::edit2::
For giggles, I decided to do a reconfigure per the docs, just in case brain damage was the issue here. It did not change things.