diff --git a/conf/nginx.conf b/conf/nginx.conf index 51eff66..92f9d7d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -25,23 +25,23 @@ location @radicale { uwsgi_param SERVER_NAME $server_name; } -#INFCLOUD#location __PATH__/infcloud { -#INFCLOUD# alias __FINALPATH__/infcloud; -#INFCLOUD# if ($scheme = http) { -#INFCLOUD# rewrite ^ https://$server_name$request_uri? permanent; -#INFCLOUD# } -#INFCLOUD# index index.html index.php ; -#INFCLOUD# try_files $uri $uri/ index.php; -#INFCLOUD# location ~ [^/]\.php(/|$) { -#INFCLOUD# fastcgi_split_path_info ^(.+?\.php)(/.*)$; -#INFCLOUD# fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; -#INFCLOUD# fastcgi_index index.php; -#INFCLOUD# include fastcgi_params; -#INFCLOUD# fastcgi_param REMOTE_USER $remote_user; -#INFCLOUD# fastcgi_param PATH_INFO $fastcgi_path_info; -#INFCLOUD# fastcgi_param SCRIPT_FILENAME $request_filename; -#INFCLOUD# } -#INFCLOUD# -#INFCLOUD# # Include SSOWAT user panel. -#INFCLOUD# include conf.d/yunohost_panel.conf.inc; -#INFCLOUD#} +__INF_CLOUD__location __PATH__/infcloud { +__INF_CLOUD__ alias __FINALPATH__/infcloud; +__INF_CLOUD__ if ($scheme = http) { +__INF_CLOUD__ rewrite ^ https://$server_name$request_uri? permanent; +__INF_CLOUD__ } +__INF_CLOUD__ index index.html index.php ; +__INF_CLOUD__ try_files $uri $uri/ index.php; +__INF_CLOUD__ location ~ [^/]\.php(/|$) { +__INF_CLOUD__ fastcgi_split_path_info ^(.+?\.php)(/.*)$; +__INF_CLOUD__ fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; +__INF_CLOUD__ fastcgi_index index.php; +__INF_CLOUD__ include fastcgi_params; +__INF_CLOUD__ fastcgi_param REMOTE_USER $remote_user; +__INF_CLOUD__ fastcgi_param PATH_INFO $fastcgi_path_info; +__INF_CLOUD__ fastcgi_param SCRIPT_FILENAME $request_filename; +__INF_CLOUD__ } +__INF_CLOUD__ +__INF_CLOUD__ # Include SSOWAT user panel. +__INF_CLOUD__ include conf.d/yunohost_panel.conf.inc; +__INF_CLOUD__} diff --git a/scripts/install b/scripts/install index db3d745..93000e8 100755 --- a/scripts/install +++ b/scripts/install @@ -75,13 +75,14 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= ynh_script_progression --message="Configure NGINX" --weight=2 -ynh_add_nginx_config if [ $infcloud -eq 1 ] then # Add InfCloud in NGINX config - ynh_replace_string "#INFCLOUD#" "" /etc/nginx/conf.d/$domain.d/$app.conf + $inf_cloud="" +else + $inf_cloud="#INFCLOUD#" fi -ynh_store_file_checksum "$finalnginxconf" +ynh_add_nginx_config #================================================= # CREATE DEDICATED USER diff --git a/scripts/upgrade b/scripts/upgrade index 6993aab..562e354 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -159,13 +159,14 @@ ynh_install_app_dependencies $pkg_dependencies if [ $overwrite_nginx -eq 1 ] then ynh_script_progression --message="Reconfigure nginx" --weight=2 - ynh_add_nginx_config if [ $infcloud -eq 1 ] then # Add InfCloud in NGINX config - ynh_replace_string "#INFCLOUD#" "" /etc/nginx/conf.d/$domain.d/$app.conf + $inf_cloud="" + else + $inf_cloud="#INFCLOUD#" fi - ynh_store_file_checksum "$finalnginxconf" + ynh_add_nginx_config fi #=================================================