I want to capture the username and password with my own form and then use those values with the Nginx ngx_http_auth_basic_module,rather than having the default Nginx box that comes up, asking for username and password? I know how to create the form, that is not part of my question.
I don't think you can solve your problem with ngx_http_auth_basic_module. I believe you need to use another module to achieve your desired result.
"ngx_http_auth_request_module" sounds like it would address your goals. It "allows authorization based on subrequest result". Here are some resources for it:
For a more detailed discussion of the topic, I recommend trying the Nginx mailing list.