Installation:
Part A
(Setting up Cloudflare)
1. Create an account at
Cloudflare.
2. Change your name servers for your domain.
3. When domain is set up, enable
force https and change ssl to
flexible.
4. Set the following DNS settings.
Type | Name | Content | TTL |
CNAME | www | @ | Auto |
A | @ | Hosting IP address | Auto |
A | proxy | Dedicated / VPS IP address | Auto |
A | sv1 | Dedicated / VPS IP address | Auto |
A | sv2 | Dedicated / VPS IP address | Auto |
A | sv3 | Dedicated / VPS IP address | Auto |
A | sv4 | Dedicated / VPS IP address | Auto |
A | sv5 | Dedicated / VPS IP address | Auto |
A | sv6 | Dedicated / VPS IP address | Auto |
Part B
(Hosting the script)
1. Download the script
here and then extract to your desktop.
2. Log into your hosting as you would usually to access file explorer on hosting.
3. Copy the contents on
"/new/source_cpanel" onto your server.
4. Go to your URL and it show display the script.
Disclaimer: This will run without the load balancer or proxy
HOWEVER if API Codes closes their proxy the script will no longer work so it's best you create your own.
Part C
(Creating the Load Balancer and Proxy)
1. Log into your VPS or Dedicated server using a SSH like Putty or Termius.
2. Run the following commands.:
Code:
CD /root/
wget http://cdn.ineeda.org/apicodes-gdriveplayer.zip
apt-get install unzip -y
apt-get install nano -y
unzip apicodes-gdriveplayer.zip
chmod 0777 setup.sh
setup.sh
3. Once the script has finished run the following command:
Code:
nano /root/LoadBalancer/models/CacheManager.js
change line 46 to the following:
Code:
CacheManager.KEY_ENCRYPT = 'apicodesdotcom'
The press CTRL + X followed by Y to save the file.
4. Once you've done the above run the following command:
Code:
nano /root/LoadBalancer/configs/servers.js
change line 4 to the following:
Code:
exports.NumberNode = 6; //The number of nodes you want to play
change line 6 to the following:
Code:
exports.DomainNode = [' INSERT YOUR OWN DOMAIN WITH NOT HTTPS OR FOLLOWING / ']; //Your primary domain
The press CTRL + X followed by Y to save the file.
5. Now run the next command:
Code:
nano /root/ProxyStream/models/CacheManager.js
change line 49 to the following:
Code:
CacheManager.KEY_ENCRYPT = 'apicodesdotcom';
Then press CTRL + X followed by Y to save the file.
6. Final edits, run the following commands:
Code:
nano /root/ProxyStream/configs/servers.js
change line 3 to the following:
Code:
exports.ALLOW_DOMAIN = []; //Domain you want to play.
7. Setting up NGINX with the proxy and load balancer.
Input the following command:
Code:
nano /etc/ngnix/ngnix.conf
The following section between lines 57 and 63 will be changes to be careful.
line 61 and 62 change to
Code:
#include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
now on line 60 enter the following:
Code:
upstream LoadBalancer {
server 127.0.0.1:6666;
}
upstream ProxyStream {
server 127.0.0.1:6868;
}
server {
listen 80;
server_name proxy.yourdomain.com;
location / {
proxy_pass http://LoadBalancer;
proxy_http_version 1.1;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 80;
server_name sv1.yourdomain.com;
location / {
proxy_pass http://ProxyStream;
proxy_http_version 1.1;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
change line 70 to the following:
Code:
server_name proxy. INSERT YOUR DOMAIN WITH NO TRAILING /;
change line 86 to the following:
Code:
server_name sv1. INSERT YOUR DOMAIN WITH NO TRAILING /;
and that's it Proxy and Load Balancer are now sorted, you just need to run the following commands to reboot NGINX and Start them.
Code:
service nginx restart
pm2 restart all
That's all done now

just need to edit a few files on your hosting to use your new load balancer and proxy.
Part D
(Linking your Dedicated with your hosting)
1. Go to your hosting file manager again, and edit the config.php file and edit line 5 with the following:
Code:
$proxyDomain = 'https://proxy. INSERT YOUR DOMAIN NAME WITHOUT THE TRAILING / ';
And viola done!