puppetlabs/puppetlabs-nginx — pull request #26 by samiconductor (2012-07-24 05:52:33+00:00)
Title: Added basic auth to server or locations

Added [auth_basic](http://wiki.nginx.org/HttpAuthBasicModule#auth_basic) and [auth_file](http://wiki.nginx.org/HttpAuthBasicModule#auth_basic_user_file) params to vhost and puppet resources.

Also added auth_location boolean param to vhost to define context of either server (false (default)) or location (true).

For vhost it was simply a matter of adding another section.

For location I split up the content into section strings.

Is there any reason not to use instance vars in the auth templates? I just noticed they aren't used elsewhere and they help out with the shared variable problem.

Let me know if anything needs tweaked. Please consider including this as I use basic auth a lot for quick and dirty security on my home server.

Great module! Thanks!