diff --git a/nginx.tmpl b/nginx.tmpl index d861050..6c87653 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -285,8 +285,10 @@ server { {{ end }} {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }} - auth_basic "Restricted {{ $host }}"; - auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }}; + limit_except OPTIONS { + auth_basic "Restricted {{ $host }}"; + auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }}; + } {{ end }} {{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }} include {{ printf "/etc/nginx/vhost.d/%s_location" $host}};