From 11fe18fa5e6aede08302f5f26099785bd37a76ac Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 12 Sep 2022 14:49:06 -0700 Subject: [PATCH] Adjust X-Sendfile configuration Resolves #212 --- config/environments/appliance.rb | 2 +- config/environments/production.rb | 2 +- config/environments/staging.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/environments/appliance.rb b/config/environments/appliance.rb index 585ce961e..12a2264f4 100644 --- a/config/environments/appliance.rb +++ b/config/environments/appliance.rb @@ -38,7 +38,7 @@ # `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-Sendfile' unless config.public_file_server.enabled # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. diff --git a/config/environments/production.rb b/config/environments/production.rb index d98e32095..e00a032db 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -35,7 +35,7 @@ # config.action_controller.asset_host = 'http://assets.example.com' # 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-Sendfile' unless config.public_file_server.enabled # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Store uploaded files on the local file system (see config/storage.yml for options). diff --git a/config/environments/staging.rb b/config/environments/staging.rb index e5af85b68..c98c532d9 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -38,7 +38,7 @@ # `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-Sendfile' unless config.public_file_server.enabled # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.