First git clone this repo. Then open the nginx folder. there you'll find setup.sh file
git clone https://github.com/bubundas17/fivem-ddos-protector.gitcd fivem-ddos-protector/nginxNow run
sudo bash setup.shIt will install nginx nodejs and some other dependencies.
After that go back to root of this project and run
sudo npm installnow edit config.js and enter domain name and fivem server ip and port.
IMPORTENT Also enter the IP of current server to "serverIP" field of config.js
after that run
sudo node update-nginx-conf.jsIt will build nginx config and iniceate Iptables rules. After that point A records to corosponding domains.
Now run the nodejs server
pm2 startup
pm2 start bin/www
pm2 saveopen config.js and add/remove domains from config.js
and run
sudo node update-nginx-conf.js
To regenerate Nginx configs.
now restart nodejs webserver
pm2 restart allServer.CFG setup :
sv_forceIndirectListing true
sv_listingHostOverride dbrpwhitelist.ml
sv_listingIpOverride "52.237.97.98"
sv_proxyIPPranges "52.237.97.98/32"
SSL INSTALLER :
sudo certbot