Changing the URL in configurations leads to redirects to old URL

Because my setup did not work corrrect I tried to go back to root-installation https://gitlab.example.com:1337/ instead of https://shared.example.com/gitlab.

I changed it everywhere (config/gitlab.yml; config/application.rb - and all mentioned here). I changed nginx configuration. I rebuild assets. I cleared cache. I flushed redis. I restarted gitlab.

Nothing helps - I still see this in my logs:

==> log/production.log <==
Started GET "/" for x.x.x.x at 2016-02-20 09:48:18 +0100
Processing by RootController#index as HTML
Redirected to http://shared.example.com/gitlab/
Filter chain halted as :authenticate_user! rendered or redirected
Completed 302 Found in 6ms (ActiveRecord: 0.0ms)
==> log/gitlab-workhorse.log <==
gitlab.example.com:1337 @ - - [2016-02-20 09:48:18.613874742 +0100 CET] "GET / HTTP/1.1" 302 107 "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36" 0.142369

The intresting part: It was https before but it redirects to http. Second: when I try to access /dashboard it redirects to /users/sign_in as expected.

I'm on 8.4.4