recipes/infra/scripts/nginx/setup_basic_nginx.sh

18 lines
No EOL
447 B
Bash

export MY_DOMAIN="my_domain"
apt install nginx
ufw allow 'Nginx HTTP'
mkdir -p /var/www/$MY_DOMAIN/html
chown -R $USER:$USER /var/www/$MY_DOMAIN/html
chmod -R 755 /var/www/$MY_DOMAIN
echo "Hello world" | /var/www/$MY_DOMAIN/html/index.html
cp basic_serverblock.txt /etc/nginx/sites-available/$MY_DOMAIN
ln -s /etc/nginx/sites-available/$MY_DOMAIN /etc/nginx/sites-enabled/
# sudo nano /etc/nginx/nginx.conf
server_names_hash_bucket_size 64;