40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
clear
|
|
|
|
# *****************************************************************************
|
|
# Script: setup-nginx-proxy / setup-nginx-proxy.sh
|
|
# Author: Robert Partridge
|
|
# URL: https://gitea.techaddressed.com/robert/setup-nginx-proxy
|
|
# *****************************************************************************
|
|
|
|
# update system
|
|
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean
|
|
|
|
# install packages
|
|
sudo apt install ntp nginx certbot ufw -y
|
|
|
|
# copy scripts
|
|
mkdir ~/bin
|
|
cp scripts/*.sh ~/bin
|
|
|
|
# copy config files
|
|
sudo cp config/example* /etc/nginx/sites-available/
|
|
sudo cp config/mime.types /etc/nginx/
|
|
sudo cp config/nginx.conf /etc/nginx/
|
|
sudo cp config/cloudflare-only.conf /etc/nginx/
|
|
sudo cp config/*realip.conf /etc/nginx
|
|
|
|
# restart services
|
|
sudo systemctl restart nginx
|
|
|
|
# configure ufw firewall but do not enable
|
|
sudo ufw allow 80/tcp
|
|
sudo ufw allow 443/tcp
|
|
|
|
# complete
|
|
echo
|
|
echo
|
|
echo "SETUP COMPLETE"
|
|
echo "UFW SET TO ALLOW PORTS 80/TCP AND 443/TCP"
|
|
echo "IF NEEDED - MAKE ADDITIONAL FIREWALL MODIFICATIONS BEFORE ENABLING UFW"
|