Hands-on tutorial
Tutorials · DevOps & Containers
How to Publish Internal Web Apps Securely With a Reverse Proxy and Automatic TLS
Put a reverse proxy such as Caddy in front of internal web applications on an edge server: automatic HTTPS certificates, one entry point, access restrictions and security headers.
Before you start
- A Linux edge server with Docker
- A domain name you control and DNS records for each application
- Firewall rules allowing ports 80 and 443 to the proxy only
Step by step
Run the proxy
Run Caddy in a container with persistent storage for certificates.
docker run -d --name caddy -p 80:80 -p 443:443 \ -v $PWD/Caddyfile:/etc/caddy/Caddyfile -v caddy_data:/data caddy:2
Define the sites
Each hostname forwards to an internal application; Caddy obtains and renews certificates automatically.
portal.example.com { reverse_proxy 10.0.20.15:8080 }
Restrict access
Limit admin applications to office or VPN IP ranges, and add authentication where the application has none.
Add security headers
Enable HSTS and sensible security headers, and hide server version information.
Keep applications private
Applications listen only on internal addresses; the proxy is the only thing exposed.
Log and monitor
Send proxy logs to your logging system and alert on unusual errors or traffic.
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Use split-horizon DNS so internal users reach the same names.
- Back up the proxy configuration with the rest of the server.
- Consider a WAF for public applications.
FAQ
Frequently asked questions
Why not open the application port directly?
A reverse proxy centralises TLS, access control and logging, and keeps applications off the internet.
Can the proxy run on the gateway?
Usually it runs on an edge server or VM behind the gateway, with port forwarding only to the proxy.
Keep learning
Related guides
Split-horizon DNS
Read more →Internal TLS certificates with a private CA
Read more →What is a WAF?
Read more →How to Use SSH Keys Instead of Passwords for Network Devices and Servers
Passwords can be guessed, phished and reused. Create an SSH key pair, install the public key on gateways, edge servers and Linux hosts, then turn password logins off.
Read more →How to Reach Remote Sites Safely With an SSH Jump Host
Do not expose SSH on every device. Put one hardened jump host (bastion) in front of the management network and reach everything else through it.
Read more →How to Open a Device Web Page Through an SSH Tunnel
Reach the web interface of a switch, NVR or container on a remote site without opening a firewall port: forward it through SSH.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.