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

Caddy

By default, Caddy automatically obtains and renews TLS certificates for all your sites. It serves all configured sites over HTTPS.

Download Caddy from their website and install it following their official documentation.

Create a file called "Caddyfile" (no extension) in the same directory where Caddy is installed with the following configuration:

<your_domain> {
reverse_proxy <pingplotter_ip_address>:<pingplotter_port>
}

Now run Caddy:

caddy run

You should now be able to access PingPlotter's Web UI via https by visiting your domain.

For more information, please see Caddy's Reverse proxy quick-start guide.

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";
}
}

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

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;
}
}

Additional resources:



Article ID: 138
Created On: September 12, 2018
Last Updated On: September 13, 2024

Online URL: https://www.pingman.com/kb/article/creating-a-reverse-proxy-for-pingplotter-s-web-ui-138.html