HeadlinesBriefing favicon HeadlinesBriefing.com

Run Nginx Reverse Proxy on OpenWrt Router

DEV Community •
×

A developer advocates running Nginx directly on an OpenWrt router to handle reverse proxying for a homelab. This approach eliminates an extra network hop, simplifies architecture, and centralizes SSL termination. The author uses an OpenWrt One router, which provides sufficient resources for hosting 25+ services, all accessible via clean subdomain URLs like `grafana.raspberrypi.home`.

OpenWrt’s UCI (Unified Configuration Interface) manages Nginx settings, generating configs automatically. The setup uses SNI to route traffic based on hostname. A single wildcard SSL certificate covers all subdomains. This method centralizes network management—DHCP, DNS, firewall, and proxy—on one device, reducing complexity and improving uptime since the router is always on.

The author details installing Nginx, configuring server blocks and location files, and setting up dnsmasq for local DNS resolution. Services like Home Assistant and Grafana are proxied, requiring specific backend configurations. This architecture is resource-efficient, using under 200MB RAM for 25 services, making it a practical solution for scaling a homelab without adding dedicated hardware.