For example: a.example.com/index.html
corresponds to /a-direcoty/index.html
, while b.example.com/index.html
Corresponds to /b-direcoty/index.html
给我你的怀抱2017-05-16 17:14:52
server {
listen 80;
server_name ~^(?<subdomain>.+).example.com$;
index index.html index.htm;
root /$subdomain-direcoty/;
}
phpcn_u15822017-05-16 17:14:52
nginx configuration file can set the server segment, and set server_name in the server to specify the domain name. So in this case, set up two servers, one with two domain names, and then set root as a specific directory