Browse Source

[fix] Error in nginx conf

ljf 2 years ago
parent
commit
9d1c338ccf
1 changed files with 8 additions and 8 deletions
  1. 8 8
      scripts/config

+ 8 - 8
scripts/config

@@ -217,27 +217,27 @@ ynh_app_config_apply() {
         echo "location / {" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
         if [[ "$captive_portal__1" == "1" ]]
         then
-            echo "    if (\$remote_addr ~ "^$ip4_nat_prefix__1.\d+$") {" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "    if (\$remote_addr ~ "^$ip4_nat_prefix__1.\d+$") {" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
 
-            echo "      return 302 $captive_portal_url__1;" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "      return 302 $captive_portal_url__1;" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
 
             echo "    }" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
         fi
         if [[ "$captive_portal__2" == "1" ]]
         then
-            echo "    if (\$remote_addr ~ "^$ip4_nat_prefix__2.\d+$") {" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "    if (\$remote_addr ~ "^$ip4_nat_prefix__2.\d+$") {" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
 
-            echo "      return 302 $captive_portal_url__2;" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "      return 302 $captive_portal_url__2;" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
 
-            echo "    }" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "    }" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
         fi
         if [[ "$captive_portal__3" == "1" ]]
         then
-            echo "    if (\$remote_addr ~ "^$ip4_nat_prefix__3.\d+$") {" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "    if (\$remote_addr ~ "^$ip4_nat_prefix__3.\d+$") {" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
 
-            echo "      return 302 $captive_portal_url__3;" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "      return 302 $captive_portal_url__3;" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
 
-            echo "    }" > /etc/nginx/conf.d/default.d/redirect_to_admin.conf
+            echo "    }" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
         fi
         echo "    return 302 https://\$http_host/yunohost/admin;" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf
         echo "}" >> /etc/nginx/conf.d/default.d/redirect_to_admin.conf