1、子域名指向固定目录下,默认跳转到index.html
server {
listen 80;
server_name www.baidu.com;
location / {
root /usr/local/nginx/html/ceshiwenjian;
index index.html index.htm;
}
}
2、子域名根据不同配置值访问不同端口,以及访问静态文件
server {
listen 80;
server_name aaa.baidu.com;
#微信后端
location /wxmsAPI/{
proxy_pass http://000.000.000.000:8086/;
}
#微信js安全域名访问文件
location /MP_ver*****************.txt {
root /usr/local/html/;
autoindex on;
}
}