From b2d796c9ec69a5e67fbe7716dac1f68e17a7cb6a Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 19 Sep 2021 15:27:57 +0200 Subject: [PATCH] Allowing subpath --- conf/nginx.conf | 7 ++++--- manifest.json | 10 ++++++++++ scripts/change_url | 2 +- scripts/install | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3af9dcc..e6279cf 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location / { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { # Force usage of https if ($scheme = http) { @@ -13,9 +14,9 @@ location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host $host; + proxy_set_header Host $host; proxy_http_version 1.1; - + # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; diff --git a/manifest.json b/manifest.json index 759f4cd..0ec872c 100755 --- a/manifest.json +++ b/manifest.json @@ -32,6 +32,16 @@ "name": "domain", "type": "domain" }, + { + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for n8n", + "fr": "Choisissez un chemin pour n8n" + }, + "example": "/n8n", + "default": "/n8n" + }, { "name": "admin", "type": "user" diff --git a/scripts/change_url b/scripts/change_url index 4af83d4..8b95c98 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path="/" +new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/install b/scripts/install index 0d559f0..ec0a6e7 100755 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url="/" +path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD admin=$YNH_APP_ARG_ADMIN