From c2df32dd5e6db84331b15d5c18832f18112f7652 Mon Sep 17 00:00:00 2001 From: ericharth Date: Wed, 19 Feb 2014 00:17:59 +0000 Subject: [PATCH 1/5] Added sendfile off; as default sendfile off; should prevent the problems with nginx serving up corrupt files by forcing it to read from disc each time. --- templates/vhost/vhost_header.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/vhost/vhost_header.erb b/templates/vhost/vhost_header.erb index ae0217dba..a3dd1b1d7 100644 --- a/templates/vhost/vhost_header.erb +++ b/templates/vhost/vhost_header.erb @@ -34,4 +34,5 @@ server { access_log <%= @access_log_real %>; error_log <%= @error_log_real %>; + sendfile off; From c09a6382e1bb81a9eb0ef029ee86df4a7af47f9a Mon Sep 17 00:00:00 2001 From: ericharth Date: Wed, 19 Feb 2014 00:18:45 +0000 Subject: [PATCH 2/5] sendfile off; as default --- templates/vhost/vhost_ssl_header.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/vhost/vhost_ssl_header.erb b/templates/vhost/vhost_ssl_header.erb index 2de8b1e4c..7466a9e94 100644 --- a/templates/vhost/vhost_ssl_header.erb +++ b/templates/vhost/vhost_ssl_header.erb @@ -23,6 +23,7 @@ server { access_log <%= @ssl_access_log %>; error_log <%= @ssl_error_log %>; + sendfile off; <% if @root -%> root <%= @root %>; From f59ec0fbe6f8820076081a348d53441618f620b9 Mon Sep 17 00:00:00 2001 From: ericharth Date: Wed, 19 Feb 2014 00:21:04 +0000 Subject: [PATCH 3/5] Changed sendfile to be controlled by parameters --- templates/vhost/vhost_ssl_header.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/vhost/vhost_ssl_header.erb b/templates/vhost/vhost_ssl_header.erb index 7466a9e94..f3b55f877 100644 --- a/templates/vhost/vhost_ssl_header.erb +++ b/templates/vhost/vhost_ssl_header.erb @@ -23,7 +23,7 @@ server { access_log <%= @ssl_access_log %>; error_log <%= @ssl_error_log %>; - sendfile off; + sendfile <%= @sendfile %>; <% if @root -%> root <%= @root %>; From 9016ecd3d996e5405b324bdff654bbcad074145d Mon Sep 17 00:00:00 2001 From: ericharth Date: Wed, 19 Feb 2014 00:21:28 +0000 Subject: [PATCH 4/5] Changed sendfile to be controlled by parameters --- templates/vhost/vhost_header.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/vhost/vhost_header.erb b/templates/vhost/vhost_header.erb index a3dd1b1d7..9dcb7b790 100644 --- a/templates/vhost/vhost_header.erb +++ b/templates/vhost/vhost_header.erb @@ -34,5 +34,5 @@ server { access_log <%= @access_log_real %>; error_log <%= @error_log_real %>; - sendfile off; + sendfile <%= @sendfile %>; From e6fd23ae7593ac5a9e5f90ded0adfdecc66ece1a Mon Sep 17 00:00:00 2001 From: ericharth Date: Wed, 19 Feb 2014 00:22:30 +0000 Subject: [PATCH 5/5] Added sendfile option --- manifests/resource/vhost.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index 15f167f41..e78448444 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -136,6 +136,7 @@ $error_log = undef, $passenger_cgi_param = undef, $use_default_location = true, + $sendfile = 'off', ) { validate_array($location_allow)