########################################################################
# 基于端口代理
########################################################################
server {
listen 81;
server_name localhost;
location / {
proxy_pass http://192.168.0.153:9091;
proxy_redirect default;
}
location = /50x.html {
root html;
}
}
server {
listen 82;
server_name localhost;
location / {
proxy_pass http://git.itplh.com;
proxy_redirect default;
}
location = /50x.html {
root html;
}
}
########################################################################
# 基于域名代理 + gitlocal负载均衡
########################################################################
upstream gitlocal{
server 192.168.0.153:9091;
server 192.168.0.154:9091;
server 192.168.0.155:9091;
}
upstream gitbj{
server git.itplh.con;
}
server {
listen 80;
server_name gitlocal.com;
location / {
proxy_pass http://gitlocal;
proxy_redirect default;
}
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name gitbj.com;
location / {
proxy_pass http://gitbj;
proxy_redirect default;
}
location = /50x.html {
root html;
}
}