about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2023-03-16 02:55:13 +0100
committerGitHub <noreply@github.com>2023-03-16 02:55:13 +0100
commit8cb2543ee571e47be46195eed798194136aeae4c (patch)
treeb550e7bc243b41fc7a7d4a6be0da84a9ea353f85
parent6fa81ca17e50c2f66a4357fc6866b33b7a606b42 (diff)
Add `SENDFILE_HEADER` environment variable (#24123)
-rw-r--r--config/environments/production.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 345a255a7..b8536c53a 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -38,8 +38,7 @@ Rails.application.configure do
   # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
 
   # Specifies the header that your server uses for sending files.
-  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
-  config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
+  config.action_dispatch.x_sendfile_header = ENV['SENDFILE_HEADER'] if ENV['SENDFILE_HEADER'].present?
 
   # Allow to specify public IP of reverse proxy if it's needed
   config.action_dispatch.trusted_proxies = ENV['TRUSTED_PROXY_IP'].split(/(?:\s*,\s*|\s+)/).map { |item| IPAddr.new(item) } if ENV['TRUSTED_PROXY_IP'].present?