代理设置
使用反向代理将 OpenReplay 与其他应用程序一起托管
Section titled 使用反向代理将 OpenReplay 与其他应用程序一起托管当 OpenReplay 在某台机器上运行时,它会使用 80/443 端口来对外提供应用程序。但当你使用反向代理时,可以将 OpenReplay 配置为使用其他端口来访问应用程序。以下是具体操作步骤:
- 编辑配置文件:
openreplay -e
- 修改 nginx 配置部分:
ingress-nginx: &ingress-nginx
controller:
...
...
service:
externalTrafficPolicy: "Local"
ports:
http: 880 # Change this port for http
https: 8443 # Change this port for https
- 使用
:wq保存并退出配置,以便 OpenReplay 重新加载配置。
随后即可配置你的反向代理。请参考以下各节进行配置。
NGINX 设置
Section titled NGINX 设置确保你的代理正在发送 X-Forwarded-For 和 X-Forwarded-Proto 标头。还必须启用 SSL,OpenReplay 才能正常工作。其余配置应如下所示:
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://1.2.3.4:880; # replace with OpenReplay instance IP
}
Apache2 设置
Section titled Apache2 设置确保已启用 proxy、proxy_http 和 proxy_html 模块。同样必须配置 SSL,其余设置应与以下内容类似:
<VirtualHost *:443>
ProxyPass / http://1.2.3.4:880 <!-- replace with instance IP -->
RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
# SSL + other config here
</VirtualHost>
如果你使用代理保护 OpenReplay 实例,请确保以下端点可公开访问,以便 OpenReplay 正常工作。
| 端点 | 说明 |
|---|---|
| /ingest | 用于捕获事件和录制 |
| /api | 用于拉取和管理用户数据 |
| /assist | 用于与最终用户进行实时视频/通话(WebRTC) |
| /ws-assist | 用于与最终用户进行实时会话回放 |
| /static/openreplay.js | 加载 OpenReplay 的 JavaScript 代码 |