1
maga 2014 年 3 月 30 日 via iPhone rewrite 写个正则匹配?
|
2
xoxo 2014 年 3 月 30 日 server{
server_name ~^(?<prefix>.+)\.x\.123\.com$; ... location / { set $hostbase '.y.abc.com'; set $host2proxy $prefix$hostbase ; proxy_pass $host2proxy; .... } } i will be glad if works... |
3
hourui 2014 年 3 月 30 日 首先 server_name ~^it\.(?<subdomain>[^\.]+)\.123\.com$;
然后 proxy_pass http://it.$subdomain.abc.com/; 大功告成 |
4
xsziran 2014 年 3 月 30 日 https://code.google.com/p/7ghost/
这个应该可以 不过好像停止开发了 |
6
ysjdx 2014 年 3 月 31 日 server {
listen [::]:80; server_name *.x.123.com; location / { if ($host ~* ^(.*).x.123.com$) { set $domain $1; proxy_pass http://$domain.y.abc.com; } } } |
10
michelh OP @ysjdx 113.110.xxx.xxx - - [03/Apr/2014:16:03:01 +0800] "GET /favicon.ico HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
|
12
coolloyal 2014 年 4 月 13 日 @ysjdx
我这也是这个情况502错误,请问他的问题解决了吗? server { listen 80; server_name ~^(www\.)?(?<domain>.+)\..+$; index index.php index.html index.htm; location / { proxy_pass http://$domain.xxx.com/; } } |