nginx同域名配置多目录路径

2025-04-14 09:20:38
推荐回答(1个)
回答1:

server{
server_name xxx.cn;
charset utf-8;
location / {
index index.html index.shtml;
root /web/t; 新路径
error_page 404 = @not_found;
}

location @not_found {
index index.html index.shtml;
root /web1/t; 老路径
}

}