From 8134c875c897ae289639fa730fb5458de380d8cf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:22:58 +0100 Subject: [PATCH] fix --- conf/nginx.conf | 18 ++++++++++++------ scripts/_common.sh | 33 --------------------------------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5b83c4d..cf3b636 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,12 +5,18 @@ location __PATH__/ { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - - proxy_pass http://localhost:__PORT__; - proxy_set_header Host $host; - proxy_buffering off; - fastcgi_param REMOTE_USER $remote_user; - client_max_body_size 200M; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + rewrite ^__PATH__/gogs/(.*) /$1 break; + rewrite ^__PATH__/gogs$ /$1 break; + proxy_pass http://localhost:__PORT__; + proxy_read_timeout 90; + + client_max_body_size 200M; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/scripts/_common.sh b/scripts/_common.sh index e3c14e2..6849d61 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -2,11 +2,6 @@ # SET ALL CONSTANTS #================================================= - -DATADIR="/home/$app" -REPO_PATH="$DATADIR/repositories" -DATA_PATH="$DATADIR/data" - # Detect the system architecture to download the right tarball # NOTE: `uname -m` is more accurate and universal than `arch` # See https://en.wikipedia.org/wiki/Uname @@ -25,34 +20,6 @@ ynh_detect_arch(){ echo $architecture } - -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. -# ynh_detect_arch(){ -# local architecture -# if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then -# architecture="arm64" -# elif [ -n "$(uname -m | grep 86)" ]; then -# architecture="i386" -# elif [ -n "$(uname -m | grep 64)" ]; then -# architecture="x86-64" -# elif [ -n "$(uname -m | grep armv7)" ]; then -# architecture="armv7" -# elif [ -n "$(uname -m | grep armv6)" ]; then -# architecture="armv6" -# elif [ -n "$(uname -m | grep armv5)" ]; then -# architecture="armv5" -# else -# architecture="unknown" -# fi -# echo $architecture -# } - #================================================= # DEFINE ALL COMMON FONCTIONS #=================================================