Actually adds trailing slash like it's supposed to.

This commit is contained in:
Aaron Louie 2020-05-25 09:29:21 -04:00
parent f88e074d6e
commit 2976a687c6
3 changed files with 5 additions and 10 deletions

View File

@ -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

View File

@ -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"

View File

@ -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;
}
root /usr/share/nginx/html;
index index.html index.htm;
location $BASE_HREF/ {
alias /usr/share/nginx/html;
index index.html index.htm;
try_files $uri$args $uri$args/ $BASE_HREF/index.html =404;
}