Using http basic authentication with custom form

Hello,

Is there a way to use http basic authentication with nginx with a custom
form?

I heard that it may be possible to use auth_request to do this but am
unsure how

My main goal is to avoid the standard form that pops up with http basic
authentication and supply my own form.

That way I still have the cacheing benefits of auth_basic with a custom
form

Any suggestions?