在二级域名目录下(例如:www.abc.com/test/h5/)发布uni-app开发的H5,uni-app在发布h5的时候有个默认的的发布配置文件
"h5" : {
"title" : "H5",
"router" : {
"mode" : "history",
"base" : "/test/h5/"
},
"devServer" : {
"https" : false
},
"domain" : "http://www.abc.com"
}
nginx配置如下:
root /usr/share/nginx/html;
location / {
root /usr/share/nginx/html/;
index index.html index.htm;
}
location /test/h5 {
alias /usr/share/nginx/html/test/h5;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}