diff --git a/CHANGELOG.md b/CHANGELOG.md index 04f9484..f8226b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ chef_rails_nginx CHANGELOG ====================== +0.3.17 +----- +- Fix duplicate location "/" error when `basic_auth` and `upstream` are enabled #1 + 0.3.16 ----- - Update nginx to 1.19.10 diff --git a/metadata.rb b/metadata.rb index 96764c9..4833be9 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'MIT' description 'Installs/Configures chef_rails_nginx' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.3.16' +version '0.3.17' depends 'chef_nginx' depends 'acme' diff --git a/templates/default/nginx_custom.erb b/templates/default/nginx_custom.erb index 2bceb26..fe6fb09 100644 --- a/templates/default/nginx_custom.erb +++ b/templates/default/nginx_custom.erb @@ -89,13 +89,13 @@ server { ssl_stapling_verify on; <%- end -%> -<%- if @basic_auth_file -%> +<%- if @basic_auth_file && !@upstream -%> location <%=@basic_auth_location %> { auth_basic "Restricted Access!"; auth_basic_user_file <%=@basic_auth_file %>; } - <%- end -%> + gzip_types application/atom+xml application/javascript @@ -159,6 +159,10 @@ server { proxy_pass http://<%= @name %>; } location / { + <%- if @basic_auth_file -%> + auth_basic "Restricted Access!"; + auth_basic_user_file <%=@basic_auth_file %>; + <%- end -%> try_files $uri @app; } <%- end -%>