Knowledge Base

Creating a reverse proxy for PingPlotter’s Web UI

Question

I've been running the PingPlotter Web UI, and I am hoping to set up access via a reverse proxy. How can I do this?


Solution

PingPlotter doesn't currently have an officially-supported way to set up a reverse proxy for the new web UI introduced in version 5.18. However, we do have a solution we have been using in-house which employs a reverse proxy using NGINX.

Begin by downloading NGINX and configuring it as normal. Within the default nginx.conf file, use the following code. You should replace 'localhost' and the listen port (9999) with whatever values you need.

server {
listen 9999;
server_name localhost;
location / {
proxy_pass http://127.0.0.1:7464/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}

The last three lines in this configuration technically are not necessary. However, without them, PingPlotter will communicate using long-polling rather than WebSockets, which dramatically slows down the responsiveness of the web UI.

If this configuration does not work for your situation, the following configuration also achieves a working reverse proxy that uses WebSockets:

map $http_upgrade $connection_upgrade {
default upgrade;
' ' close;
}
server {
listen 9999;
server_name localhost;
location / {
proxy_pass http://127.0.0.1:7464/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}

If you're looking to set up the Web UI with HTTPS and are running Windows (macOS coming at a later date), we have an excellent resource for that in the PingPlotter manual.

Additional resources:


Article Rating (No Votes)

Rate this article


Article Info

Article Number: 138 | Last Updated: July 1, 2020

This article has been viewed 2464 times since September 12, 2018

Filed Under: PingPlotter Pro

Attachments

There are no attachments for this article.