HTTPS on UniFi Cloud Key, with Remote Access Support, the Easy Way

You can try this method if you meet one of the following situation: You have a public IP to the internet (both static and dynamic IPs should work, but you should need DDNS service if you don’t have static IP) Your ISP restricts 80 or 443 access to the internet (like in China) You don’t want hacks or some tricky commands on Unifi Cloud Key like HOWTO: Install Signed SSL Certificate on Cloudkey and use for secure portal or Setting up HTTPS on the UniFi CloudKey. (Both require install CA issued certificates on UCK) Requirements A public IP to the internet (to access Unifi Security Gateway remotely) A server running Nginx on public internet A CA issued certificate Set port forwarding for your Cloud Key In general, you can access your Unifi Secuiry Gateway (USG) via your public IP (USG_IP), so in my method you need to forward your UCK management dashboard (UCK_IP:8443 by default) traffic to your public IP. it’s under Settings – Routing & Firewall – Port Forwarding. Enter your Cloud Key address IP as Forward IP, use default 8443 as Port and Forward Port. You can also limit from destination to your server IP for security best practice. Setup Nginx proxy Use the following Nginx configuration, please note that this is a simplified version. Update DNS records Point your unifi.example.com to your public IP. Access it in your browser and everything now should works! References UniFi – Port Requirements for Cloud Key UniFi – USG Port Forwarding Configuration and Troubleshooting HOWTO: Install Signed SSL Certificate on Cloudkey and use for secure portal Setting up HTTPS on the UniFi CloudKey Related Posts Nginx Notion Proxy Debian 手動編譯安裝 nginx + PHP-FPM 指北 How to Generate SSL Certificate Chain for Nginx UniFi Cloud Key: MongoDB Out of Memory Issue Export Website RSA Private Key for Apache Server Certificate from OS X Server