server {
...
set $subdomain /www;
if ( $host ~* (\b(?!www\b)\w+)\.\w+\.\w+ ) {
set $subdomain /$1;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
if ( $subdomain = "/sd" ) {
proxy_pass http://www.bitmap.cc:8090;
break;
}
root /mnt/html$subdomain;
index index.html index.htm;
}
...
}
网友评论