From 666c2b1cb5a786c34e57e5ea22690b58bec39b61 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 6 Feb 2018 19:46:50 +0000 Subject: [PATCH] If daemon is specified then use proxy_pass --- src/freedombone-template | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/freedombone-template b/src/freedombone-template index 642aa78d..ca3b2f3c 100755 --- a/src/freedombone-template +++ b/src/freedombone-template @@ -222,6 +222,9 @@ echo "${app_name_upper}_CODE=" echo "${app_name_upper}_ONION_PORT=$(( ( RANDOM % 1000 ) + 9010 ))" echo "${app_name_upper}_REPO=\"${app_repo}\"" echo "${app_name_upper}_COMMIT='${app_repo_commit}'" +if [ $app_daemon ]; then + echo "${app_name_upper}_PORT=TODO" +fi echo '' echo "${app_name}=(ONION_ONLY" echo " ${app_name_upper}_DOMAIN_NAME" @@ -670,7 +673,11 @@ if [ $app_onion_only ]; then echo " echo ' # Location' >> \$${app_name}_nginx_site" echo " echo ' location / {' >> \$${app_name}_nginx_site" echo " nginx_limits \$${app_name_upper}_DOMAIN_NAME '15m'" - echo " echo ' try_files \$uri \$uri/ @${app_name};' >> \$${app_name}_nginx_site" + if [ ! $app_daemon ]; then + echo " echo ' try_files \$uri \$uri/ /index.html;' >> \$${app_name}_nginx_site" + else + echo " echo ' proxy_pass http://localhost:\$${app_name_upper}_PORT;' >> \$${app_name}_nginx_site" + fi echo " echo ' }' >> \$${app_name}_nginx_site" echo " echo '}' >> \$${app_name}_nginx_site" echo ' else' @@ -708,7 +715,11 @@ fi echo " echo ' # Location' >> \$${app_name}_nginx_site" echo " echo ' location / {' >> \$${app_name}_nginx_site" echo " nginx_limits \$${app_name_upper}_DOMAIN_NAME '15m'" -echo " echo ' try_files \$uri \$uri/ @${app_name};' >> \$${app_name}_nginx_site" +if [ ! $app_daemon ]; then + echo " echo ' try_files \$uri \$uri/ index.html;' >> \$${app_name}_nginx_site" +else + echo " echo ' proxy_pass http://localhost:\$${app_name_upper}_PORT;' >> \$${app_name}_nginx_site" +fi echo " echo ' }' >> \$${app_name}_nginx_site" echo " echo '}' >> \$${app_name}_nginx_site" if [[ "$app_php" == 'yes' ]]; then