使用 apache 作为代理时,Mattermost Websocket 握手失败

使用 apache 作为代理时,Mattermost Websocket 握手失败

我的服务器上的 Mattermost 安装没有取得任何进展。我已经安装了一切,没有任何问题。

之后,我启用了 apache modproxy_wstunnel并在我的 Plesk 域中添加了以下指令以获取其他指令(如<VirtualHost *:80><VirtualHost *:443>):

HTTP:

ErrorLog ${APACHE_LOG_DIR}/mattermost-error.log
CustomLog ${APACHE_LOG_DIR}/mattermost-access.log combined

# Enforce HTTPS:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

HTTPS:

ServerName mattermost.xxx.de
ProxyPreserveHost On

# Set web sockets
ProxyRequests Off
RemoteIPHeader CF-Connecting-IP
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]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RequestHeader set X-Forwarded-Proto "https"

<LocationMatch "^/api/v(?<apiversion>[0-9]+)/(?<apiusers>users/)?websocket">
    Require all granted
    ProxyPass ws://127.0.0.1:8065/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
    ProxyPassReverse ws://127.0.0.1:8065/api/v%{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
    ProxyPassReverseCookieDomain 127.0.0.1 mattermost.xxx.de
</LocationMatch>

<Location />
    Require all granted
    ProxyPass http://127.0.0.1:8065/
    ProxyPassReverse http://127.0.0.1:8065/
    ProxyPassReverseCookieDomain 127.0.0.1 mattermost.xxx.de
</Location>

但是当我保存它,重新启动 apache 并返回到 Mattermost 时,我仍然收到 Websocket 错误:

在此输入图像描述

在网络选项卡中,响应为空......

相关内容