Broken links to files in repository when upgrading from 12.0

I have a gitlab instance on version 11 I recently updated to version 12.0.12.
I have access to gitlab on my internal LAN and a HTTPS port forward for accessing it from an external IP address.

I am attempting to upgrade to the latest version (through the proper upgrade path) but am getting an issue when I updated to the latest point release in 12 (12.13). File links in repository pages are behaving differently in the new version, breaking previous access from the external IP. I can still access gitlab (browse pages, edit wiki) from the external IP but file links now point to [internal IP] and are inaccessible from [external IP] without manually changing the IP in the URL.
If I adjust the external_url setting in gitlab.rb to [external IP] these links follow and can be clicked when accessing gitlab via [external IP], but then are incorrect when gitlab is accessed from [internal IP].
I tried continuing to version 13.0 and the issue remained so I have rolled back to 12.0 for now.
What is causing just the repository clone links to behave differently between 12.0 and 12.13? Is there a configuration change I can make to revert this behavior to the file links use the IP address

I am also having this issue. My gitlab ee instance is hosted behind a firewall at “servername.soemthing.com” which can be viewed from other computers on the domain. When I click on a link to a file it redirects to “gitlab.servername.something.com/…” which adds the “gitlab” to the start of the domain. By removing the gitlab at the start of the address, I can see the files. I upgraded from 12.9.2 --> 12.10.14 --> 13.0.0 --> 13.1.3 to try to fix the problem, but it remains.