recipes/infra/scripts/nginx/setup_basic_nginx.sh

18 lines
447 B
Bash
Raw Normal View History

export MY_DOMAIN="my_domain"
2024-03-13 09:09:02 +00:00
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
2024-03-13 09:09:02 +00:00
echo "Hello world" | /var/www/$MY_DOMAIN/html/index.html
2024-03-13 09:09:02 +00:00
cp basic_serverblock.txt /etc/nginx/sites-available/$MY_DOMAIN
2024-03-13 09:09:02 +00:00
ln -s /etc/nginx/sites-available/$MY_DOMAIN /etc/nginx/sites-enabled/
2024-03-13 09:09:02 +00:00
# sudo nano /etc/nginx/nginx.conf
server_names_hash_bucket_size 64;