Jang go Tsenya le go Beakanya Nginx mo Linux Server
Kaelo ya kgato ka kgato ya go tsenya le go beakanya Nginx web server mo di-distribution tsa Ubuntu le CentOS Linux.

Nginx ke web server e e nang le tiragatso e e kwa godimo le reverse proxy server. E itsege ka go nitama, dikarolo tse di humileng, le tshebediso e e kwa tlase ya disebediswa. Kaelo e e tla go thusa go tsenya le go beakanya Nginx mo Hiddence Linux server ya gago.
Go Tsenya Nginx mo Ubuntu/Debian
Ntšhwafatsa lenaane la di-package mme o tsenye Nginx:
sudo apt update
sudo apt install nginx -yGo Tsenya Nginx mo RHEL / CentOS / AlmaLinux / Rocky Linux
Tsenya EPEL repository le Nginx:
sudo yum install epel-release -y
sudo yum install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginxPeakanyo ya Motheo
Difayele tsa peakanyo tsa Nginx di kwa /etc/nginx/. Fayele e kgolo ya peakanyo ke nginx.conf. Mo Ubuntu/Debian, di-server block di kwa /etc/nginx/sites-available/, mo di-system tse di ikaegileng ka RHEL di kwa /etc/nginx/conf.d/. Testa peakanyo mme o reload:
sudo nginx -t
sudo systemctl reload nginxGo Beakanya Virtual Host
Tlhama server block ya domain ya gago:
sudo nano /etc/nginx/sites-available/yourdomain.com
# Tsenya peakanyo ya server block
sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxBeakanya Firewall
Letlelela traffic ya HTTP le HTTPS:
sudo ufw allow 'Nginx Full'
# Kgotsa ya firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reloadDikeletso tse di Mosola
- Testa peakanyo ka gale pele ga o reload: sudo nginx -t
- Tlhola di-error log tsa Nginx: sudo tail -f /var/log/nginx/error.log
- Dirisa di-server block tsa di-website tse di mmalwa mo server e le nngwe
- Letlelela Gzip compression go na le tiragatso e e botoka
- Beakanya SSL certificates tsa HTTPS (bona kaelo ya rona ya SSL)