1
kslr 2018-10-25 23:24:30 +08:00
upstream
|
2
0xABCD 2018-10-25 23:50:59 +08:00 via Android
跟配置负载均衡一样啊,多机器
|
4
greenskinmonster 2018-10-26 09:44:01 +08:00 via Android
用域名的话,只是 Nginx 启动时解析一下,后面域名 IP 变了,你要自己去 reload Nginx 才行
|
5
xivisi 2018-10-26 10:10:36 +08:00
有同样需求
|
6
jsjcjsjc OP @greenskinmonster 可惜 nginx 不能经常 reload。。感概
|
7
greenskinmonster 2018-10-26 11:01:06 +08:00
@jsjcjsjc 定时检查到 ddns ip 变化以后,reload nginx 即可。
reload 还是 restart 可能要测试下,我一个服务网也是类似情况,不是关键业务,所以是 restart nginx。 |
8
jsjcjsjc OP @greenskinmonster 感谢,我试一下
|
9
jsjcjsjc OP 自己顶一下,还是不是特别满意~~
|
10
jsjcjsjc OP @greenskinmonster 貌似不行啊~~
upstream jsjc.domain.io:30000 { server kakxkakx.domain.io:30000 weight=1; server jsjc.myqnapcloud.com:30000 weight=1; server test.henjimo.com:30000 weight=1; } server { listen 80; server_name thenas.domain.io; if ($http_user_agent ~* (baiduspider|360spider|haosouspider|googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)) { return 403; } location / { sub_filter jsjc.domain.io:30000 thenas.domain.io; sub_filter_once off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Referer http://jsjc.domain.io:30000; proxy_set_header Host jsjc.domain.io:30000;#此处注意 proxy_pass http://jsjc.domain.io:30000; proxy_set_header Accept-Encoding ""; } } |