Gitlab_Mattermost setup unable to redirect http to https

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.

Mattermost Version: 7.0.1
Database Schema Version: 85
Database: postgres

Gitlab version 15.1

I found another topic with the same problem:

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.

Yes, both are on different servers. Both were installed using omnibus. i.e Mattermost omnibus and Gitlab Omnibus.

I edited your post for better formatting and removed your password, JFYI.

Can you please try to change the following line in mmomni.mattermost.env to also point to https?

MM_SERVICESETTINGS_SITEURL=http://mywebsite.net

Then run the command mmomni reconfigure, restart the mattermost service (systemctl restart mattermost) and try again, please.

I did that. Still got the same error. URI is invalid.