Reverse Proxy configuration using NGINX
Introduction
This guide explains how to configure NGINX as a reverse proxy for Defguard's components (Core and Edge). The reverse proxy acts as an intermediary between users and Defguard services, handling HTTPS requests and ensuring encrypted connections.
To provide HTTPS encryption, this guide also uses Certbot, a free, open-source tool from the Let's Encrypt project. Certbot automatically issues and renews SSL/TLS certificates, allowing you to secure your Defguard domains without manual certificate management.
Installing NGINX and Certbot
To install and prepare NGINX with Let's Encrypt certificates:
apt install nginx certbot
systemctl enable nginx.service
systemctl start nginx.serviceDisable the default configuration to avoid conflicts:
unlink /etc/nginx/sites-enabled/defaultObtaining SSL Certificates
Before configuring NGINX, issue valid SSL certificates for your domains. In this example we use:
Core: my-server.defguard.net
Edge: enroll.defguard.net
Generate certificates with Certbot:
Certbot will generate certificate in fullchain.pem and privkey.pem in the following paths:
Defguard Core NGINX configuration
Create a new configuration file for the Core service:
/etc/nginx/sites-available/my-server.defguard.net.conf
Enable the configuration and reload NGINX:
To verify, run:
Defguard Edge (Enrollment Service) NGINX configuration
The Edge service exposes APIs and Web UI for desktop & mobile client configuration and the user password reset process.
Create its NGINX configuration file:
/etc/nginx/sites-available/enroll.defguard.net.conf
Enable and restart NGINX:
Security Recommendations
Only expose HTTPS port 443 for public web access.
Do not expose internal gRPC ports (8000, 8080, 50051, 50066) directly to the Internet.
Summary
After completing the configuration:
Defguard Core is available at
https://my-server.defguard.netEdge services are available at
https://enroll.defguard.netBoth services are secured with SSL and reverse-proxied through NGINX.
Was this helpful?