How does nginx correspond to resource files in different directories according to different subdomain names?
黄舟
黄舟 2017-05-16 17:12:52
0
2
651

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

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
给我你的怀抱
server {
listen 80;
server_name ~^(?<subdomain>.+).example.com$;
index index.html index.htm;
root /$subdomain-direcoty/;
}
phpcn_u1582

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!