1. update & upgrade os
- sudo apt update && apt upgrade -y
2. Install nginx
- sudo apt install nginx -y
3. Allow firewall if enable
- sudo ufw allow 'Nginx HTTP'
4. Check status nginx
- systemctl status nginx
5. Config server block for your domain
- sudo nano /etc/nginx/sites-available/test.com
server {
listen 80;
listen [::]:80;
server_name test.com www.test.com;
location / {
include proxy_params;
proxy_pass http://192.168.0.100;
}
}
6. Enable configuration
- sudo ln -s /etc/nginx/sites-available/test.com /etc/nginx/sites-enabled/
7. Check syntax errors
- sudo nginx -t
8. If no problem, restart nginx
- sudo systemctl restart nginx
DONE
0 komentar:
Posting Komentar