diff --git a/nginx.tmpl b/nginx.tmpl index 2414633..51a4f02 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -352,8 +352,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}};