Reverse Proxy with Frigate NVR
In this example, we will show how to set up Gruxi as a reverse proxy for Frigate NVR, which is a popular open-source network video recorder (NVR) that uses machine learning to detect and record video from security cameras.
By using Gruxi as a reverse proxy, you can easily access the Frigate NVR web interface and stream video feeds from your cameras through Gruxi, while also benefiting from Gruxi's features such as SSL termination.
It is also a good example because it utilizes some of the more advanced features of Gruxi, such as WebSocket support and low latency, to ensure that the reverse proxy setup works smoothly with Frigate NVR's web interface and streaming capabilities.
Check out Frigate NVR's website for more information.
The setup
Let's assume you have Frigate NVR running on a server internally with the following details:
- Frigate NVR IP address:
192.168.1.100on port8971for authenticated access. It is running TLS, but with a self-signed certificate.
You want to set up Gruxi as a reverse proxy to access the Frigate NVR web interface at https://nvr.yourdomain.com/, and Gruxi is running on the same network (or has access to it) at the edge with internet access.
This requires Gruxi to handle the TLS connections from the outside world, and then forward the requests to the internal Frigate NVR server. Additionally, since Frigate NVR's web interface uses WebSockets for real-time updates and video streaming, Gruxi needs to support WebSocket proxying to ensure that the web interface works correctly through the reverse proxy.
Prerequisites:
- Gruxi installed and running on a server that can access the Frigate NVR server
- Frigate NVR installed and running on an internal server with the IP address
192.168.1.100 - A domain name (e.g.,
nvr.yourdomain.com) that points to the Gruxi server's IP address
You can set up Gruxi to act as a reverse proxy for Frigate NVR as follows:
- Log in to the Gruxi admin portal and open the configuration.
- Add a
Siteand fill out the hostnamenvr.yourdomain.com. - Add a
Proxy ProcessorunderProcessors. - Add an
Upstream serverwith the following entry:https://192.168.1.100:8971(https, because Frigate NVR is running TLS, even if it is self-signed). - Set the
Health Check pathto/api/version - Make sure to uncheck
Verify TLS certificateat the top of the proxy processor, since Frigate NVR is running with a self-signed certificate.
Save that configuration and reload it in the admin portal. You should now be able to access the Frigate NVR web interface at https://nvr.yourdomain.com/ through Gruxi, and all features of the web interface should work correctly, including real-time updates and video streaming through WebSockets.
Make sure to wait a few moments after reloading the configuration
This is because Gruxi takes a moment to generate the TLS certificate for the new hostname. If you try to access the site immediately after reloading, you might get a TLS error or a connection error. Just wait a few moments and then try accessing https://nvr.yourdomain.com/ again, and it should work correctly.
Learn more about proxying with Gruxi
To learn more details about the way Gruxi supports reverse proxying, check out the Proxy processor documentation.