最简配置
前提环境
apt install nginx -y
rm -r /etc/nginx/*
最简反向代理配置
events {
}
http {
server {
listen 80;
location / {
proxy_pass https://www.baidu.com;
}
}
}
最简负载均衡
events {
}
http {
upstream cluster {
server ubuntu101:8080 weight=1;
server ubuntu102:8080 weight=1;
server ubuntu103:8080 weight=1;
}
location / {
proxy_pass http://cluster;
}
}