Actually adds trailing slash like it's supposed to.
This commit is contained in:
parent
f88e074d6e
commit
2976a687c6
|
@ -71,7 +71,7 @@ services:
|
|||
# image: sartography/cr-connect-bpmn:$E2E_TAG
|
||||
# environment:
|
||||
# - API_URL=http://localhost:5000/v1.0
|
||||
# - BASE_HREF=/
|
||||
# - BASE_HREF=/bpmn
|
||||
# - HOME_ROUTE=home
|
||||
# - IRB_URL=http://localhost:5001
|
||||
# - PORT0=5002
|
||||
|
|
|
@ -32,7 +32,7 @@ fi
|
|||
if [[ "$2" == *"BASE_HREF"* ]]; then
|
||||
length=${#BASE_HREF}
|
||||
last_char=${BASE_HREF:length-1:1}
|
||||
[[ $last_char == "/" ]] && BASE_HREF="$BASE_HREF"; :
|
||||
[[ $last_char != "/" ]] && BASE_HREF="$BASE_HREF/"; :
|
||||
|
||||
# The third parameter is the absolute path to the nginx html directory
|
||||
if [[ $# -ge 3 ]]; then
|
||||
|
@ -50,7 +50,7 @@ fi
|
|||
env_list="\\\$${2//,/ \\\$}" # "\" and "$" are escaped as "\\" and "\$"
|
||||
for file_path in ${1//,/ }
|
||||
do
|
||||
echo "replacing $env_list in $file_path"
|
||||
echo "replacing environment variables in $file_path"
|
||||
|
||||
# Replace strings in the given file(s) in env_list
|
||||
envsubst "$env_list" < "$file_path" > "$file_path".tmp && mv "$file_path".tmp "$file_path"
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
server {
|
||||
listen $PORT0;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri$args $uri$args/ /index.html =404;
|
||||
}
|
||||
|
||||
location $BASE_HREF/ {
|
||||
alias /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri$args $uri$args/ $BASE_HREF/index.html =404;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue