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 http://myserver.com/static/main.d0d2ee96fc2c25e74c2c.js

Any suggestions?

Cheers

1 Like

guide URL: https://docs.mattermost.com/install/config-proxy-apache2.html

this is something that is currently not possible with Mattermost. See https://mattermost.atlassian.net/browse/ABC-70 and https://github.com/mattermost/mattermost-server/issues/7490#issuecomment-334041774 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: https://mattermost.atlassian.net/browse/MM-10366.

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 https://docs.mattermost.com/install/config-proxy-apache2.html
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://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]

<Location /mattermost>
Require all granted
ProxyPass http://127.0.0.1:8065/
ProxyPassReverse http://127.0.0.1:8065/
</Location>

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:
http://example.com/foo
http://example.com/bar
http://example.com/mattermost
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?