From 26e07b4741a025224ed4f76b7ea7fab43dbc0267 Mon Sep 17 00:00:00 2001 From: Bryan Gwilliam Date: Sun, 25 Feb 2018 20:32:08 -0700 Subject: [PATCH] add etag support at the http level --- manifests/config.pp | 1 + manifests/init.pp | 1 + spec/classes/nginx_spec.rb | 6 ++++++ templates/conf.d/nginx.conf.erb | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 9e9290786..bd53afb44 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -51,6 +51,7 @@ $client_body_timeout = $::nginx::client_body_timeout $send_timeout = $::nginx::send_timeout $lingering_timeout = $::nginx::lingering_timeout + $etag = $::nginx::etag $events_use = $::nginx::events_use $fastcgi_cache_inactive = $::nginx::fastcgi_cache_inactive $fastcgi_cache_key = $::nginx::fastcgi_cache_key diff --git a/manifests/init.pp b/manifests/init.pp index 82cb8b618..1cf6decd1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -65,6 +65,7 @@ $client_body_timeout = '60s', $send_timeout = '60s', $lingering_timeout = '5s', + Optional[Enum['on', 'off']] $etag = undef, Optional[String] $events_use = undef, String $fastcgi_cache_inactive = '20m', Optional[String] $fastcgi_cache_key = undef, diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index 527977531..790b77f7f 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -478,6 +478,12 @@ value: 'off', notmatch: %r{multi_accept} }, + { + title: 'should set etag', + attr: 'etag', + value: 'off', + match: ' etag off;' + }, { title: 'should set events_use', attr: 'events_use', diff --git a/templates/conf.d/nginx.conf.erb b/templates/conf.d/nginx.conf.erb index a5c16977e..fbd12305e 100644 --- a/templates/conf.d/nginx.conf.erb +++ b/templates/conf.d/nginx.conf.erb @@ -96,6 +96,10 @@ http { lingering_timeout <%= @lingering_timeout %>; tcp_nodelay <%= @http_tcp_nodelay %>; +<% if @etag -%> + etag <%= @etag %>; + +<% end -%> <% if @gzip == 'on' -%> gzip on; <% if @gzip_buffers -%>