MM Server Subpath Issue

Hi Jesse,

Good news. I got HTTPS working. Now I can get some sleep.

Please review with your team, it’s possible something is missing or can be done in a better way.

Please create a document on the document.mattermost.org explaining how to achieve this so that people know what to do instead of trying to guess.

I’m not using virtualhosts because now MM is using subpath. It could be done, if needed, I leave this to you.

{Client} - HTTP/HTTPS - {Server : [Apache] - Port 8065 - [Mattermost]}

  • MM server settings:

Site URL: http://myserver.com/mattermost
Port: :8065
80To433: false
Connection Security: None

  • Apache.conf:

ProxyPreserveHost on
ProxyRequests off

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

     Require all granted
     ProxyPass              ws://localhost:8065/mattermost/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
     ProxyPassReverse ws://localhost:8065/mattermost/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
< /LocationMatch>

<Location “/mattermost”>
     Require all granted
     ProxyPass              http://localhost:8065/mattermost
     ProxyPassReverse http://localhost:8065/mattermost
< /Location>