how to set up a https RPC, using NGINX and Certbot.
Frist, ensure that all packages are up to date. This can prevent security vulnerabilities.
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install -y glances
sudo apt install -y nginx
sudo ufw enable && \
sudo ufw allow 'Nginx HTTP' && \
sudo ufw allow 'Nginx HTTPS' && \
sudo ufw allow 22
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot certonly --manual --preferred-challenges dns \
--email <your-email-address> \
-d <your-domain.abc>
Remove Existing Nginx Configuration:
sudo rm -rf /etc/nginx/nginx.conf
Edit New Configuration: Use a text editor like nano to create a new configuration file.
sudo nano /etc/nginx/nginx.conf
-
Replace the contents with your load balancer configuration. You can use the Example Nginx config as a starting point.
-
Modify RPC/LCD/gRPC server entries and domain names as required.
sudo nginx -t
sudo systemctl enable nginx && sudo systemctl start nginx
crontab -e
Then, add:
0 12 * * * /usr/bin/certbot renew --quiet