I’m experiencing an issue with the proxy configuration for Mattermost.
My env.:
Server A – Web server, proxy, and internet gateway (running Apache2)
Server B – Mattermost server (IP: 192.168.100.15)
Error: “Please check your connection, Mattermost is unavailable. If the issue is not available, ask your administrator to enable the Websocket port.”
Apache2 log:
[Thu Jul 25 14:03:53.339846 2024] [proxy:error] [pid 96487] [client 79.187.92.58:56685] AH00898: Error during SSL Handshake with remote server returned by /api/v4/websocket
[Thu Jul 25 14:03:54.282932 2024] [proxy:error] [pid 94790] (20014)Internal error (specific information not available): [client 79.187.92.58:57806] AH01084: pass request body failed to 192.
168.100.15:443 (192.168.100.15)
[Thu Jul 25 14:03:54.282986 2024] [proxy:error] [pid 94790] [client 79.187.92.58:57806] AH00898: Error during SSL Handshake with remote server returned by /api/v4/websocket
[Thu Jul 25 14:03:55.219146 2024] [proxy:error] [pid 94787] (20014)Internal error (specific information not available): [client 79.187.92.58:55088] AH01084: pass request body failed to 192.
168.100.15:443 (192.168.100.15)
[Thu Jul 25 14:03:55.219175 2024] [proxy:error] [pid 94787] [client 79.187.92.58:55088] AH00898: Error during SSL Handshake with remote server returned by /api/v4/websocket
Host file:
<VirtualHost *:80>
ServerName teamchat.domain.xyz
Redirect permanent / https://teamchat.domain.xyz
</VirtualHost>
<VirtualHost *:443>
ServerName teamchat.domain.xyz
SSLEngine on
SSLProxyEngine On
SSLCertificateFile /var/www/html/domain/ssl/domain.xyz.crt
SSLCertificateKeyFile /var/www/html/domain/ssl/domain.xyz.key
# SSLCertificateChainFile /var/www/html/domain/ssl/domain.xyz.bundle
ErrorLog /var/log/apache2/mattermost-error.log
CustomLog /var/log/apache2/mattermost-access.log combined
ProxyPreserveHost On
ProxyRequests Off
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 .* wss://192.168.100.15:443%{REQUEST_URI} [P,QSA,L]
<LocationMatch "^/api/v(?<apiversion>[0-9]+)/(?<apiusers>users/)?websocket$">
Require all granted
ProxyPass wss://192.168.100.15:443/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
ProxyPassReverse wss://192.168.100.15:443/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
ProxyPassReverseCookieDomain 192.168.100.15 teamchat.domain.xyz
</LocationMatch>
<Location />
Require all granted
ProxyPass https://192.168.100.15/
ProxyPassReverse https://192.168.100.15/
ProxyPassReverseCookieDomain 192.168.100.15 teamchat.domain.xyz
</Location>
</VirtualHost>
I can connect to Mattermost on the local network by changing the hosts file in Windows:
192.168.100.15 teamchat.domain.xyz
And it works well.
I’m not skilled enough with Apache to figure out what else I can do.
Versions:
Server version: Apache/2.4.38 (Debian)
Server built: 2023-04-21T22:01:00
Mattermost ver:
Version: 7.4.0
Build Number: 7.4.0
Build Date: Wed Oct 12 19:37:03 UTC 2022
Build Hash: 8cb6718a9bcc45186f62baed2304248d3cabaa50
Build Enterprise Ready: true
Karol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.