How to Use Nginx as a Reverse Proxy to Serve SiteView-Web

This article applies to Linux systems.

SiteView-Web normally runs on a local port such as:

http://localhost:5000

If you want users on the network to access SiteView-Web through a standard web address, you can use Nginx as a reverse proxy.

Nginx receives HTTP requests from web browsers and forwards them to SiteView-Web running on port 5000.

For example:

Web Browser
    ↓
http://192.168.1.100
    ↓
Nginx, Port 80
    ↓
SiteView-Web, Port 5000

1. Install Nginx

If Nginx is not already installed, run:

sudo apt update
sudo apt install nginx

After the installation is complete, Nginx should start automatically.

You can verify its status using:

sudo systemctl status nginx

2. Configure Nginx

Open the default Nginx site configuration:

sudo nano /etc/nginx/sites-available/default

If this Linux system is dedicated to SiteView-Web, you can replace the existing contents with the following configuration:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    server_name _;

    location / {
        proxy_pass http://127.0.0.1:5000;

        proxy_http_version 1.1;

        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_set_header X-Forwarded-Proto $scheme;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

This configuration tells Nginx to accept web requests on port 80 and forward them to SiteView-Web running on:

127.0.0.1:5000

Press:

Ctrl + X

Then press:

Y

and press Enter to save the file and exit Nano.

3. Check the Nginx Configuration

Before restarting Nginx, verify that the configuration does not contain any syntax errors:

sudo nginx -t

If the configuration is correct, you should see a message indicating that the syntax is OK and the configuration test was successful.

4. Restart Nginx

Apply the new configuration:

sudo systemctl restart nginx

You can verify that Nginx is running with:

sudo systemctl status nginx

5. Access SiteView-Web

From another computer or device on the same network, open a web browser and enter:

http://[IP address of the Linux system]

For example:

http://192.168.1.100

Nginx will receive the request on port 80 and forward it internally to SiteView-Web on port 5000.

You should now see the SiteView-Web login or main page.

Optional: Access SiteView-Web Using a Domain Name

If you have a domain name or internal DNS name pointing to the Linux server, you can also access SiteView-Web using that name.

For example:

http://siteview.example.com

In this case, replace:

siteview.example.com

with:

server_name: siteview.example.com;

Important

This configuration uses standard HTTP on port 80.

If SiteView-Web will be accessed over the public Internet, using HTTPS is strongly recommended. HTTPS can be configured in Nginx using an SSL/TLS certificate.

For private corporate networks, VPN access can also be used so that SiteView-Web remains accessible only to authorized remote users.