用途
||作用|
|-|-|-|
|负载均衡|软负载均衡,平衡不同服务器的压力
|反向代理|通过Nginx可以把任务分发到不同webserver,增加性能
反向代理配置
# http://xx.com/api/* -> http://localhost:8090/*
location /api/ {
proxy_pass http://localhost:8090/;
}
# http://xx.com/api/* -> http://localhost:8090/api/*
location /api/ {
proxy_pass http://localhost:8090;
}
location /api {
proxy_pass http://localhost:8090;
}
# http://xx.com/api/* -> http://localhost:8090//*
location /api {
proxy_pass http://localhost:8090/;
}