There’s been a few questions on setting up Apache and Mattermost, just taking this post from @alerque and making it easier to find:
<VirtualHost *:443>
ServerName mattermost.alerque.com
DocumentRoot /usr/share/webapps/mattermost/web
SSLEngine on
SSLCertificateFile /etc/httpd/ssl.crt/alerque.com.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/alerque.com.key
ProxyPreserveHost On
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/api/v1/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]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RequestHeader set X-Forwarded-Proto "https"
<Location /api/v1/websocket>
Require all granted
ProxyPassReverse ws://127.0.0.1:8065/api/vi/websocket
ProxyPassReverseCookieDomain 127.0.0.1 mattermost.alerque.com
</Location>
<Location />
Require all granted
ProxyPassReverse http://127.0.0.1:8065/
ProxyPassReverseCookieDomain 127.0.0.1 mattermost.alerque.com
</Location>
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
ErrorLog /var/log/httpd/mattermost.alerque.com_error.log
CustomLog /var/log/httpd/mattermost.alerque.com_forwarded.log common_forwarded
CustomLog /var/log/httpd/mattermost.alerque.com_access.log combined env=!dontlog
CustomLog /var/log/httpd/mattermost.alerque.com.log combined
</VirtualHost>
Thanks @alerque! From: