How to emulate features of htaccess file

my original apache .htaccess file for a site looked like this:

AuthUserFile /var/www/htpasswd
AuthType Basic
AuthName MySite
Require valid-user

BrowserMatchNoCase HAPPYBOT is_happy
Order Deny,Allow
Deny from all
Allow from env=is_happy
Satisfy Any

i figured i could do something close w/ the ngx_http_browser_module,
but i can’t get the Passwd auth to work if i put in a thing to match
as a “modern” browser.

any hints or pointers would be appreciated.