I want to implement http auth if the password file exists for the user's home directory, if it doesn't exist then nginx should bypass the http auth. Following is in my vhost file. location ~ ^/users/(.+?)(/.*)?$ { include localhost.access; auth_basic "Restricted"; auth_basic_user_file access.logins/$1; alias /var/www/test/ssl/users/$1/ssl/$2; autoindeby adeelarifbhatti - Migration from Other Servers