Proxy Settings
Hosting OpenReplay with other applications using reverse proxy
Section titled Hosting OpenReplay with other applications using reverse proxyWhen OpenReplay is running in a machine, it’ll use port 80/443 to expose the application. But when you’re using a reverse proxy, OpenReplay can be configured to use another port to access the application. Below are the steps on how to do that:
- Edit config file:
openreplay -e
- Change the nginx config section:
ingress-nginx: &ingress-nginx
controller:
...
...
service:
externalTrafficPolicy: "Local"
ports:
http: 880 # Change this port for http
https: 8443 # Change this port for https
- Save and exit the config using
:wqso OpenReplay can reload the configuration.
Your reverse proxy can then be configured. Refer to the below sections to do so.
NGINX settings
Section titled NGINX settingsMake sure your proxy is sending the X-Forwarded-For and X-Forwarded-Proto headers. SSL must also be enabled for OpenReplay to work. The rest of the config should look like this:
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 settings
Section titled Apache2 settingsEnsure proxy, proxy_http and proxy_html modules are enabled. SSL too should be configured, the rest of the settings should be similar to this:
<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>
Public endpoints
Section titled Public endpointsIn case you’re protecting your OpenReplay instance with a proxy, ensure the below endpoints are publicly accessible for OpenReplay to work properly.
| Endpoint | Description | Originator |
|---|---|---|
| /ingest | For ingesting events and recordings coming from your app | Your tracked app(s) (if publicly accessible then this endpoint should be public too) |
| /ws-assist | For live session replays with end users (WebSocket) | Your tracked app(s) (if publicly accessible then this endpoint should be public too) |
| /api | For authentication and fetching of sessions, projects, RBAC and account data | OpenReplay Dashboard |
| /v2/api | For search, analytics, session replay and co-browsing | OpenReplay Dashboard |
| /spots | For pulling spot videos from the object storage | OpenReplay Dashboard |
| /mobs | For pulling session replays from the object storage | OpenReplay Dashboard |
| /sessions-assets | For pulling cached stylesheets and fonts from the object storage | OpenReplay Dashboard |
| /static | For pulling data related to co-browsing sessions | OpenReplay Dashboard |
| /records | For pulling co-browsing recordings from object storage | OpenReplay Dashboard |
| /integrations | For fetching logs from 3-rd party integrations (like Sentry or Datadog) | OpenReplay Dashboard |
| /sourcemaps | For uploading sourcemaps | Sourcemaps CLI |
| /spot | For fetching data related to spot recordings | Spot Chrome Extension |
| /script | Useful if you wish to serve the openreplay-*.js files from your setup (otherwise defaults to OpenReplay CDN) | Your tracked app(s) |
Have questions?
Section titled Have questions?If you have any questions about this process, feel free to reach out to us on our Slack or check out our Forum.