diff --git a/docker/front.conf b/docker/front.conf index 3107966f..b528beb8 100644 --- a/docker/front.conf +++ b/docker/front.conf @@ -51,9 +51,10 @@ server { gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.0; + QL_ROOT_CONFIG location QL_BASE_URL_LOCATION { - QL_ROOT_OR_ALIAS /ql/static/dist; + QL_ALIAS_CONFIG index index.html index.htm; try_files $uri QL_BASE_URLindex.html; } diff --git a/shell/share.sh b/shell/share.sh index cccdd052..b67f0b76 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -468,14 +468,18 @@ init_nginx() { cp -fv $nginx_conf /etc/nginx/nginx.conf cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf local location_url="/" - local root_or_alias="root" + local aliasStr="" + local rootStr="" if [[ $ql_base_url != "/" ]]; then location_url="^~${ql_base_url%*/}" - root_or_alias="alias" + aliasStr="alias ${dir_static}/dist;" + else + rootStr="root ${dir_static}/dist;" fi + sed -i "s,QL_ALIAS_CONFIG,${aliasStr},g" /etc/nginx/conf.d/front.conf + sed -i "s,QL_ROOT_CONFIG,${rootStr},g" /etc/nginx/conf.d/front.conf sed -i "s,QL_BASE_URL_LOCATION,${location_url},g" /etc/nginx/conf.d/front.conf sed -i "s,QL_BASE_URL,${ql_base_url},g" /etc/nginx/conf.d/front.conf - sed -i "s,QL_ROOT_OR_ALIAS,${root_or_alias},g" /etc/nginx/conf.d/front.conf ipv6=$(ip a | grep inet6) ipv6Str=""