From de208db3acb3ca71748991bceb97cad855f13d43 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 8 May 2017 21:22:16 +0200 Subject: [PATCH] Apply port change on install and nginx.conf --- conf/nginx_root.conf | 2 +- conf/nginx_sub_dir.conf | 2 +- scripts/install | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/nginx_root.conf b/conf/nginx_root.conf index 4e42919..6772cd4 100644 --- a/conf/nginx_root.conf +++ b/conf/nginx_root.conf @@ -3,7 +3,7 @@ location / { proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-WEBAUTH-USER $remote_user; - proxy_pass http://127.0.0.1:5000; + proxy_pass http://127.0.0.1:YNH_WWW_PORT; proxy_http_version 1.1; proxy_pass_request_headers on; proxy_set_header Connection "keep-alive"; diff --git a/conf/nginx_sub_dir.conf b/conf/nginx_sub_dir.conf index e6cfdd3..d84b0fa 100644 --- a/conf/nginx_sub_dir.conf +++ b/conf/nginx_sub_dir.conf @@ -14,7 +14,7 @@ location ~ YNH_WWW_PATH/(?.*) { proxy_pass_request_headers on; proxy_set_header Connection "keep-alive"; proxy_store off; - proxy_pass http://127.0.0.1:5000/$ndpath$is_args$args; + proxy_pass http://127.0.0.1:YNH_WWW_PORT/$ndpath$is_args$args; gzip on; gzip_proxied any; diff --git a/scripts/install b/scripts/install index 0137169..3b5941b 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,7 @@ source ./_common.sh # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN path=$YNH_APP_ARG_PATH +port=$YNH_APP_ARG_PORT admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC @@ -79,8 +80,8 @@ sudo systemctl start influxdb sudo cp ../conf/ldap.toml /etc/grafana grafana_conf="/etc/grafana/grafana.ini" -# Set final URL -sudo sed -i '/^\[server\]$/,/^\[/ s/;http_port = .*/http_port = 5000/' $grafana_conf +# Set final port +sudo sed -i "/^\[server\]$/,/^\[/ s@;http_port = .*@http_port = $port@" $grafana_conf # Set final URL sudo sed -i "/^\[server\]$/,/^\[/ s@;root_url = .*@root_url = https://$domain$path@" $grafana_conf # Disable check for updates @@ -140,6 +141,7 @@ else fi sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf +sed -i "s@YNH_WWW_PORT@$port@g" $nginx_conf sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf # If app is public, add url to SSOWat conf as skipped_uris