Skip to content

Set a custom domain for GitHub Pages

If you want that your server services use your custom subdomain such as subdomain.example.com, you will use tool like:

Dynamic DNS with DuckDns
Figure 1: Dynamic DNS with DuckDns

Nginx Reverse Proxy with Nginx Proxy Manager
Figure 2: Nginx Reverse Proxy with Nginx Proxy Manager

Let's Encrypt for free ssl certificates
Figure 3: Let's Encrypt for free ssl certificates

Cloudflare with your custom domain
Figure 4: Cloudflare with your custom domain

Steps

  1. First of all your home IP will change from time to time. Therefore you first need to to use a Dynamic DNS service such as DuckDNS is free, reliable and highly recomended.. You can create an account and get a subdomain such as subdomain.duckdns.org.
  2. Dont forget to install and configure the DuckDNS client on your server. You can find the installation instructions on the DuckDNS Docs.
  3. For each server service setup a DNS Record for your custom subdomain in Cloudflare to the subdomain.duckdns.org which resolved to your server's ip address
    • Type CNAME
    • Name subdomain (subdomain.example.com)
    • Target subdomain.duckdns.org
    • Proxy status DNS only
    • TTL Auto
  4. You can use a reverse proxy such as Nginx Proxy Manager to manage your server services. After installing the Nginx Proxy Manager, you need to port forward the default ports for Nginx Proxy Manager in your Router:
    • 80 to 80
    • 443 to 443
  5. Within the Nginx Proxy Manager, you can create a proxy host from your new subdomain subdomain.example,com to your server service (IP and Port). In the example:

    • In the Details tab:
    • Domain Names subdomain.example.com
    • Scheme http
    • Forward Hostname/IP 192.168.0.1
    • Forward Port 10000
    • Block Common Exploits Yes
    • In the SSL tab:
    • SSL Certificate Request a new SSL Certificate
    • Force SSL Yes
    • HTTP/2 Support Yes

    6. This will send the traffic from subdomain.example.com to your server service. The SSL certificate will be automatically generated by Let's Encrypt and renewed every 3 months. 4. Wait a few minutes for the DNS records to propagate. 5. Done! Now you can access your Server Services with your custom domains on https:// such as https://subdomain.example.com.