Mattermost and Gitlab are set up in two different servers via omnibus installation. I get a “The redirect uri is not valid” error. Upon further inspection, in gitlab.rb , mattermost external uri is set to 'https://site.com" , the configuration in Gitlab admin dashboard > Admin > Application >Mattermost has https:// URLs. The setup has no mention of allowing HTTP. Redirection of HTTP to https is also enabled.
And I found an older GitHub Issue which suggests that this could be caused by a misbehaving proxy (i.e. sending the X-Forwarded-Proto header with a wrong value).
You said that you have Mattermost and Gitlab installed on two different servers using the omnibus installation. Can you describe your setup a little bit more, please? On server 1, where Mattermost is running, has this been installed using the Mattermost omnibus installation? If so, can you please share the contents of the files /etc/mattermost/mmomni.yml, /etc/mattermost/mmomni.mattermost.env and /etc/nginx/conf.d/mattermost.conf?
Make sure to remove passwords and other sensitive information from these files, please.