This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Variable for the backend service address. | |
BACKEND="127.0.0.1:8000" | |
# Echo the purpose of this script. | |
echo "This script installs Nginx, creates a self-signed SSL certificate, and configures Nginx as a reverse proxy to forward HTTPS requests to the backend service at ${BACKEND}." | |
echo "Updating package index and installing nginx and openssl..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fetch Cloudflare IP ranges | |
ipv4_url="https://www.cloudflare.com/ips-v4" | |
ipv6_url="https://www.cloudflare.com/ips-v6" | |
# Temporary files to store IP ranges | |
ipv4_file="/tmp/cloudflare_ipv4.txt" | |
ipv6_file="/tmp/cloudflare_ipv6.txt" |