1
manhere 2016 年 4 月 16 日 via iPhone 用不同入口 /目录啊
|
2
penjianfeng 2016 年 4 月 16 日 你这问题让我也想问一个问题,如何让两个妹子同时爱上我....
|
4
junnplus 2016 年 4 月 16 日 |
5
myyou OP @penjianfeng 同时戳瞎两个妹子的眼\(^o^)/~
|
6
ss098 2016 年 4 月 16 日 可以设置 Cookie 或者不同应用之间的特征码以区别应用,比如有 A 和 B 两个应用,就可以设置 Cookie application=a ,然后将所有请求转发到应用中。
|
8
wyssurvivor 2016 年 4 月 16 日 在域名后面加路径,就像 4 楼说的那样
|
10
junnplus 2016 年 4 月 16 日 location /app1 {
....rewrite /app1/(.*) /$1 break; ....proxy_pass http://localhost:5000; ....proxy_redirect off; ....proxy_set_header Host $proxy_host; ....proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } 大概这样子,具体还请自行 google ps :为什么不用二级域名反向代理呢? |
14
lux182 2016 年 4 月 16 日
域名:目录:端口
|
16
RqPS6rhmP3Nyn3Tm 2016 年 4 月 16 日 via Android
上子域啊
|
17
tobacco 2016 年 4 月 16 日 可以用请求 url 区分不同的 web 服务器,配置文件类似于:
http { server { server_name example.com; location /mail/ { proxy_pass http://example.com:protmail/; } location /com/ { proxy_pass http://example.com:portcom/main/; } location / { proxy_pass http://example.com:portdefault; } } } 可以参考这篇文章: http://blog.lwons.com/archieve/nginx_reverse_proxy.html |
18
kitalphaj 2016 年 4 月 16 日
如果你说的域名可以是 aaa.me.com 和 bbb.me.com 那就很简单。
|
19
JerningChan 2016 年 4 月 16 日
同域名,同端口,那就要不同路径了..
|
20
JerningChan 2016 年 4 月 16 日
你要把 3 个不同站点放到同一个 web 根目录入边
|
21
yangxin0 2016 年 4 月 16 日
http 里面有种东西叫 Host
|
22
beginor 2016 年 4 月 16 日 via Android
楼上正解, ng 可以配置多个 host
|
23
Fedor 2016 年 4 月 16 日 server_name
|
25
kaneg 2016 年 4 月 17 日
反向代理就是干这个活的
|
26
beginor 2016 年 4 月 17 日 via Android
同一个端口,同一个域名,又不想用 URL 或子域名,难道是要弄 load balance ?
|
29
sunnogo 2018 年 1 月 10 日
@junnplus 我也是想搞个这样的:
http://example.com/app1 http://example.com/app2 http://example.com/app3 你在 10 楼的回复,意思是不是这样: server app1, example.com:port1 server app2, example.com:port2 server app3, example.com:port3 server example.com location app1, 反向代理到 example.com:port1, location app2, 反向代理到 example.com:port2, ... |
31
sunnogo 2018 年 1 月 11 日
@junnplus 谢谢这么快回复哈~。
我的目标和楼主的也是一样,入口是同一个入口,通过 xxx.com/app1 xxx.com/app2 来区分业务。所以想问下我对你在 10 楼回复的理解是不是对的,通过 xxx.com/app1 访问,通过 location 反向代理到 xxx.com:port1。 |