Gitlab Mattermost SSO doesn't work in container

I have Gitlab and Mattermost installed in a LXD container where single sign-on is not working.
The details are in my question on the LXD forum:
The answer I got there is: “You need to make sure the service inside the instance is listening on the proxys connect IP rather than the loopback address if using Nat mode.”

Now I am wondering how this is best configured in Gitlab.
In /etc/gitlab/gitlab.rb I find a few settings referring to, all commented out. But it is not clear to me which ones I would need to uncomment or change.