From a9aba585c9a01130fa91e76e63342c156163fb11 Mon Sep 17 00:00:00 2001
From: Alain Takoudjou <alain.takoudjou@nexedi.com>
Date: Tue, 9 Aug 2016 11:43:38 +0200
Subject: [PATCH] slaprunner: remove redirect the user to account creation page
 from nginx config

---
 software/slaprunner/common.cfg    |  2 +-
 software/slaprunner/nginx_conf.in | 15 ---------------
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/software/slaprunner/common.cfg b/software/slaprunner/common.cfg
index 89224d3e5..488db608e 100644
--- a/software/slaprunner/common.cfg
+++ b/software/slaprunner/common.cfg
@@ -110,7 +110,7 @@ recipe = hexagonit.recipe.download
 ignore-existing = true
 url = ${:_profile_base_location_}/nginx_conf.in
 download-only = true
-md5sum = 94d83ef3eb89c2d75c8c079ab12b4518
+md5sum = 2b06f7eb9a1d45d250d4b92a944db925
 filename = nginx_conf.in
 mode = 0644
 
diff --git a/software/slaprunner/nginx_conf.in b/software/slaprunner/nginx_conf.in
index 1d78d141d..a0df6f95a 100644
--- a/software/slaprunner/nginx_conf.in
+++ b/software/slaprunner/nginx_conf.in
@@ -35,21 +35,6 @@ http {
         scgi_temp_path {{ param_tempdir['scgi_temp_path'] }};
 
         location / {
-            # When no .htpasswd exist, redirect the user to account creation page
-            if ( !-f {{ param_nginx_frontend['etc_dir'] }}/.htpasswd ) {
-                # redirect URL is different wether nginx is accessed directly or behind apache.
-                # nginx does not support nested if or multiple conditions, so we use this well known hack.
-                set $test no_htpasswd;
-            }
-            if ( $host = [{{ param_nginx_frontend['global-ip'] }}] ) {
-                set $test "${test}_backend_access";
-            }
-            if ( $test = no_htpasswd) {
-                return 301 $scheme://$host/setAccount ;
-            }
-            if ( $test = no_htpasswd_backend_access) {
-                return 301 /setAccount ;
-            }
             auth_basic "Restricted";
             auth_basic_user_file {{ param_nginx_frontend['etc_dir'] }}/.htpasswd;
             proxy_redirect off;
-- 
2.30.9