BLOG16: Nginx Based Webhosting
1. Port-Based Virtual Hosts
# /etc/nginx/conf.d/port_based.conf
server {
listen 8080;
server_name localhost;
location / {
root /var/www/html_port1;
index index.html;
}
}
server {
listen 9090;
server_name localhost;
location / {
root /var/www/html_port2;
index index.html;
}
}2. Name-Based Virtual Hosts
3. Load Balancer with Upstream
4. Rules / Path-based Routing
Last updated