mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复 nginx 变量替换
This commit is contained in:
parent
49ed5c6632
commit
79fd4ec58f
|
@ -51,9 +51,10 @@ server {
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_buffers 16 8k;
|
gzip_buffers 16 8k;
|
||||||
gzip_http_version 1.0;
|
gzip_http_version 1.0;
|
||||||
|
QL_ROOT_CONFIG
|
||||||
|
|
||||||
location QL_BASE_URL_LOCATION {
|
location QL_BASE_URL_LOCATION {
|
||||||
QL_ROOT_OR_ALIAS /ql/static/dist;
|
QL_ALIAS_CONFIG
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
try_files $uri QL_BASE_URLindex.html;
|
try_files $uri QL_BASE_URLindex.html;
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,14 +468,18 @@ init_nginx() {
|
||||||
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
cp -fv $nginx_conf /etc/nginx/nginx.conf
|
||||||
cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf
|
cp -fv $nginx_app_conf /etc/nginx/conf.d/front.conf
|
||||||
local location_url="/"
|
local location_url="/"
|
||||||
local root_or_alias="root"
|
local aliasStr=""
|
||||||
|
local rootStr=""
|
||||||
if [[ $ql_base_url != "/" ]]; then
|
if [[ $ql_base_url != "/" ]]; then
|
||||||
location_url="^~${ql_base_url%*/}"
|
location_url="^~${ql_base_url%*/}"
|
||||||
root_or_alias="alias"
|
aliasStr="alias ${dir_static}/dist;"
|
||||||
|
else
|
||||||
|
rootStr="root ${dir_static}/dist;"
|
||||||
fi
|
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_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_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)
|
ipv6=$(ip a | grep inet6)
|
||||||
ipv6Str=""
|
ipv6Str=""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user