Proxy Settings

Hosting OpenReplay with other applications using reverse proxy

Section titled Hosting OpenReplay with other applications using reverse proxy

When 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:

  1. Edit config file:
openreplay -e
  1. Change the nginx config section:
ingress-nginx: &ingress-nginx
      externalTrafficPolicy: "Local"
        http: 880   # Change this port for http
        https: 8443 # Change this port for https
  1. Save and exit the config using :wq so OpenReplay can reload the configuration.

Your reverse proxy can then be configured. Refer to the below sections to do so.

Make 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; # replace with OpenReplay instance IP

Ensure 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 / <!-- replace with instance IP -->
    RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
    # SSL + other config here

In case you’re protecting your OpenReplay instance with a proxy, ensure the below endpoints are publicly accessible for OpenReplay to work properly.

/ingestFor capturing events and recordings
/apiFor pulling and managing user data
/assistFor live video/calls with end users (WebRTC)
/ws-assistFor live session replays with end users
/static/openreplay.jsJavaScript code that loads OpenReplay

If you have any questions about this process, feel free to reach out to us on our Slack or check out our Forum.