Changing URL of Mattermost instalation

I just installed Mattermost on Plesk with their extension (ubuntu 18.0.4). There are no settings and it automatically installs it at example.com/mattermost I would like to change that and install it directly at example.com. I tried moving all the files to the directory for example.com and changed the URL in the UI as well as in config.json however when doing that I am getting a 403 error. I can’t seem to find instructions anywhere on how to do this.

Any help would be greatly appreciated.

Hello! There is a way to do this, as I run my Mattermost instance on a subdomain directly, and it loads the proper pages by default.

This is a configuration change that must be made in two locations–the mattermost configuration files, as well as in the website configuration file on the webserver you are using.

Would you be able to clarify if you are running Nginx or Apache as your webserver?

Yes, I believe this website is running on nginx as a proxy server

Alright, that makes sense, and should be able to be changed then as well!

In the config.json file, for your Mattermost instance, you should be able to change the URL of the server to whatever you wish it to be, by editing the site URL, as you can see from my configuration file, I have set it to run on the domain mattermost.example.tld

        "SiteURL": "https://mattermost.example.tld",
        "WebsocketURL": "",
        "LicenseFileLocation": "",
        "ListenAddress": ":8065",
        "ConnectionSecurity": "",
        "TLSCertFile": "",
        "TLSKeyFile": "",
        "TLSMinVer": "1.2",
        "TLSStrictTransport": false,
        "TLSStrictTransportMaxAge": 63072000,
        "TLSOverwriteCiphers": [],
        "UseLetsEncrypt": false,
        "LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
        "Forward80To443": false,
        "TrustedProxyIPHeader": [
            "X-Forwarded-For",
            "X-Real-IP"
        ],

It’s important to note that if you are running your Mattermost instance over HTTPS, you do need to change the protocol in your config.json file to reflect this as well.

For example, if I wanted to run my Mattermost instance on example.tld/mattermost, and serve it over HTTPS, I would change the SiteUrl to be https://example.tld/mattermost, save the file, and then restart my instance.

Does this help, I hope?

Well, I moved all the files from /mattermost to /chat and than changed the config.json from https://example.com/mattermost to https://example.com/chat and when I point my browser to /chat it showed a 404 or 403 error.
The only way I got it to work was by changing the plesk configuration file for this domain and in there changed it to /chat as well, however than I was getting a web socket error.

1 Like

That would most likely be due to needing to reconfigure the file path in the Nginx page configuration file of your setup, where you have the websocket configuration defined.

Thanks,
I guess I’ll have to try and figure something out, plesk support themselves didn’t seem to know how to help.

1 Like

Hi there, I’m facing the same issue by op. Plesk Mattermost Extension installs instances on the domain.com/mattermost path and I also want to display it like you did on the root of the domainpath. Could you have a look on my issue ? Subdomain Setup without subdirectory url not working in Plesk + NGINX

@mv-stns I did not work it out, but it seems you figured something out while I am still stuck :slight_smile:

@netzih there’s a big difference between a 404 and a 403 :slight_smile: Do you recall what exactly you’re being shown and if this problem is still there, are you unable to use Mattermost at the moment or did you revert the configuration so that MM is available at the URL /mattermost again?