2009-06-22 44 views

回答

1

你的意思是重定向,对吧?

 
http { 
    # ... 
    server { 
    server_name us.domain.com; 
    location/{ 
     rewrite ^/ http://www.domain.com/?portal=us; 
    } 
    } 
} 
3

东西没有那么快,但更普遍的:

server { 
    listen  80; 
    server_name domain.com; 
    if ($host ~* (.*)\.domain\.com) { 
     set $subdomain $1; 
     rewrite (.*) http://domain.com/?portal=$subdomain; 
    } 
相关问题