NGINX
Setup
- NGINX set up
- Follow the process (#1)
- test & iterate
CHEAT
# 1.SSH
cd ~/aws && ssh -i "MS22.pem" ubuntu@ec2-13-41-232-190.eu-west-2.compute.amazonaws.com
# 2. CD
cd /etc/nginx/conf.d
# 3. CONFD
sudo nano app.conf
# 4. RELOAD
sudo nginx -t && sudo nginx -s reload
# 5.
sudo certbot --nginx
install
# install cheat
sudo apt update && sudo apt install nginx && nginx -v
sudo ufw allow 'Nginx full' && sudo ufw enable && sudo ufw reload && sudo ufw status
# install
sudo apt update
sudo apt install nginx
nginx -v
# status
systemctl status nginx
# firewall on http90 and htpps443
sudo ufw allow 'Nginx full'
sudo ufw allow ssh
sudo ufw enable
sudo ufw reload
sudo ufw status
COnfig
cd /etc/nginx/conf.d
sudo nano app.conf
server {
listen 80;
listen [::]:80;
server_name 35.178.30.114;
location / {
proxy_pass http://127.0.0.1:18000;
}
}
server {
listen 80;
listen [::]:80;
server_name wbp.worldbestplaces.com;
location / {
proxy_pass http://127.0.0.1:18000;
}
}
Certbot
- sudo snap install core; sudo snap refresh core
- sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx