Mattermost, Inc.

Use URL subdirectory instead of port

My Mattermost server(4.6.0) is using http://myserver:8065
I would like to use http://myserver/mattermost instead.
Mattermost is being hosted in Apache so we are talking about VirtualHost with ProxyPass setup.
I’ve found a guide (mattermost apache2 unofficial setup) to do something similar but it doesn’t work for my scenario.

The browser returns:
Cannot Connect to Mattermost
not found

Any suggestions?


1 Like

guide URL:

this is something that is currently not possible with Mattermost. See and for more information.

This feature has been implemented.

Could you include it in release v5.1.0 if its not already included.

I’m really looking forward to it.

Hi @RbDev! v5.1 will include support for serving Mattermost from subpaths!

Here are links to tickets that have been completed:

1 Like

Hello! Did someone resolve this issue?
I think I have exactly the same problem on version 5.15
I have a pretty uncommon setup (mattermost 5.15 on windows server 2012 served behind Apache 2.4) and I cannot use a subdomain as suggested in this guide
So I’m trying to go on a subdirectory like http:// myserver /mattermost
I came up with this configuration

RewriteEngine On
  RewriteCond %{REQUEST_URI} /api/v[0-9]+/(users/)?websocket [NC,OR]
  RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
  RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
  RewriteRule .* ws://{REQUEST_URI} [P,QSA,L]

<Location /mattermost>
Require all granted

I can reach http:// myserver/ mattermost, but I see (like you did) that requests are “rewritten” to the server root like that http:// myserver/static/26.404f53cb4da1116e6536.js, instead of (I suppose) http:// myserver/mattermost/static/26.404f53cb4da1116e6536.js

dont use proxypass. use direct connection and conifgura subpath within mattermost.

Thx @RbDev but I think I need to pass through a reverse proxy, anyway.
I’m serving different services on the same apache host (port 80) and I’d like to add mattermost on a subdirectory like that:
I’m contrained to use port 80 also for mattermost, so I need a port mapping/reverse proxying of some sort.
Or am I missing something?