Add optional basic auth: fix bug 1021307

Add support for jinja2 deploy templates
Port nginx.conf template to jinja2 with conditional basic auth
Add auth.conf template