If you have ever used Cloudflare, you know how its proxy works. You point your domain to Cloudflare DNS and then on their side set real website’s hosting IP. Cloudflare will pass through all traffic through its network to your server. CDN node works same way – it sits between your visitors and the origin server, caching and delivering content of your website. The main purpose of CDN nodes is to create a network of nodes to lower latency of the website globally but in the same time it can be used to mask real website’s IP.
For our testing and educational purposes we will use simple VPS with below configuration. This will be enough to proxy traffic of regular website.
- CPU 2*2Ghz, 2Gb RAM, 30Gb SSD, 1 Gbit port;
- Ubuntu 20.04 LTS with root privileges and clean OS. NO Apache, nginx, cPanel etc.
- OneClickCDN – open-source software for running an CDN node.
Installation and configuration
Run the below command to start the installation:
wget https://raw.githubusercontent.com/Har-Kuun/OneClickCDN/master/OneClickCDN.sh && sudo bash OneClickCDN.sh
The process will take some time and the script will guide you through the process.
Once the installation script finishes its job you will see the menu. Press “0” and “Return”/”Enter” to exit the menu.
The next step will be to point to your CDN node the domain name you want to hide the IP address of. In our case the domain is buydomainwithbtc.com and our test CDN IP is 126.96.36.199.
Once we have pointed our domain, we need to add and configure this domain on the node itself. Use command bellow to bring back the shell menu.
Select 3 – Add a CDN Website;
The next step will be to enter the origin IP address of server where this website is hosted.
Next, enter “1” for both HTTPS and HTTP support. And finally you will be asked if you want to configure SSL for the domain. We recommend use option “2” to autoconfigure free Let’s Encrypt certificate. Your domain should already be pointed to CDN node for this option to work!
The script will take a minute to verify the domain’s ownership and obtain new SSL certificate. Once completed, you will see success message.
That’s all. You have successfully installed your first CDN node and masked the origin IP of your website. If you run a simple “ping” command, you will see that your website is responding from CDN node IP and not from the real IP, where your website is located.