1
znithy 2011-12-28 01:38:23 +08:00
可以设置很多个。
|
3
Matata OP 当我把a.com的配种从nginx删去以后,访问a.com就会到原本c希望代理到的 D上去。
a和c都解析到服务器了。 |
4
znithy 2011-12-28 04:05:44 +08:00
我特地试了下,没问题。
直接贴nginx的代码了 a.weiboes.com反向到http://airweibo.sinaapp.com/ b.weiboes.com反向到http://shiguangji.sinaapp.com/ 你可以访问下看看,我自己试了没问题。 代码的subs_filter那行是用来替换输出文本的,你没装替换插件的话就把这行删了。 --------------------------------- server { listen 80; server_name a.weiboes.com; location / { proxy_redirect off; proxy_set_header Host $proxy_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header referer http://airweibo.sinaapp.com/; proxy_pass http://airweibo.sinaapp.com/; proxy_set_header Accept-Encoding ""; subs_filter 'airweibo.sinaapp.com' 'a.weiboes.com' g; } } server { listen 80; server_name b.weiboes.com; location / { proxy_redirect off; proxy_set_header Host $proxy_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header referer http://shiguangji.sinaapp.com/; proxy_pass http://shiguangji.sinaapp.com/; proxy_set_header Accept-Encoding ""; subs_filter 'shiguangji.sinaapp.com' 'b.weiboes.com' g; } } |