Skip to content

Commit

Permalink
Merge pull request #46 from extra2000/nginx-add-listen-port-option
Browse files Browse the repository at this point in the history
feat(nginx): add optional environment variable to override NGINX default listen port
  • Loading branch information
ayoubfaouzi authored Feb 11, 2022
2 parents 5a30e90 + 41fb064 commit 6ce2827
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ VUE_APP_CSP_HOSTS="*.saferwall.com saferwall.com"

VUE_APP_BASE_URI="https://saferwall.com/"
VUE_APP_API_BASE_URL="https://api.saferwall.com/v1/"
VUE_APP_AVATAR_BASE_URL="https://avatar.saferwall.com/"
VUE_APP_AVATAR_BASE_URL="https://avatar.saferwall.com/"
NGINX_HTTP_PORT="80"
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ done
NGINX_CONF_FILE="/etc/nginx/conf.d/default.conf"
INDEX_HTML_FILE="/usr/share/nginx/html/index.html";

# Change default NGINX listen port if NGINX_HTTP_PORT env is set
if [[ -v "${NGINX_HTTP_PORT}" ]]; then
sed -i "s~listen 80~listen $NGINX_HTTP_PORT~g" $NGINX_CONF_FILE
sed -i "s~listen \[\:\:\]\:80~listen [::]:$NGINX_HTTP_PORT~g" $NGINX_CONF_FILE
fi

# api url csp
sed -i "s~connect-src~connect-src $VUE_APP_BASE_URI~g" $NGINX_CONF_FILE
Expand Down

0 comments on commit 6ce2827

Please sign in to comment.