falcon.admin.***.cn/falcon 站点需要域名收敛到 admin.***.cn/falcon,但是admin.***.cn站点已经存在,所以,需要nginx做域名收敛
原admin.***.cn DNS指向172.16.110.42,改成指向 nginx 172.16.110.12,
nginx对站点admin.***.cn做配置
vi /usr/local/nginx/vhost/admin.***.cn.conf
upstream admin_***_cn {
server 172.16.110.42:80 weight=1 max_fails=2 fail_timeout=10000;
}
upstream admin_***_cn_falcon{
server 172.16.110.120:9331 weight=1 max_fails=2 fail_timeout=10000;
}
server
{
server_name admin.***.cn;
location / {
proxy_pass http://admin_***_cn;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_redirect off;
proxy_next_upstream error timeout invalid_header http_504 http_500 http_502 http_503 http_404;
}
location /falcon {
proxy_pass http://admin_***_cn_falcon/falcon/;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;