Upstream转发
跳到导航
跳到搜索
upstream mediaiwki
#mediawiki docker 跑的 所以不是标准的 80 所以 nginx upsteam 转发一下 cmdb也是一样 #20180822 server{ listen 80; server_name wiki.com; location / { proxy_pass http://wiki.com; proxy_http_version 1.1; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } access_log off; #access_log /usr/local/nginx/logs/du.log access_log; } #代理 mediawiki upstream wiki.com { server 192.168.0.10:8080 weight=5; # 本机ip keepalive 32; }
trouble
有个不够完美的地方就是 浏览器输入wiki.com后 还是会跳转为 192.168.0.10:8080
old
# LB for abroad.game.com upstream inland.game.com { server inland.game.com:80; } server { listen 80; server_name abroad.game.com; proxy_redirect off; location / { proxy_store off; access_log /dev/null main; proxy_pass http://inland.game.com; } } check() { $NGINX_SBIN -c $NGINX_CONF -t }