i thought this would work but for some reason it skips the auth_basic and always returns 200. Same happens if i swap 200 for a 301 redirect.
If i comment out the return statement it works ok. Ideally i want just an /auth endpoint that once authenticated it will 301 redirect to another path.
 location /auth {
     auth_basic_user_file /etc/nginx/.htpasswd;
     auth_basic "Secret";
     return 200 'hello';
  }
Am i missing something ?
many thanks
fLo
 
    