Nginx 万能反向代理

DNS泛解析 *.ileiming.com 到服务器上
编辑ileiming.com.conf配置文件
# vi ileiming.com.conf

server {
resolver 8.8.8.8;
listen 80;
server_name *.ileiming.com;
index index.html index.htm index.php default.html default.htm default.php;
if ($host ~* “(.*)\.ileiming\.com”) {
set $subdomain $1;
}
location / {
default_type text/html;
proxy_set_header Referer  http://$subdomain;
proxy_pass  “http://$subdomain”;
proxy_set_header Accept-Encoding “”;
}
}

未经允许不得转载:国外主机测评 - 国外VPS,国外服务器,国外云服务器,测评及优惠码 » Nginx 万能反向代理