production.rb 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. require "active_support/core_ext/integer/time"
  2. Rails.application.configure do
  3. # Settings specified here will take precedence over those in config/application.rb.
  4. # Code is not reloaded between requests.
  5. config.enable_reloading = false
  6. # Eager load code on boot. This eager loads most of Rails and
  7. # your application in memory, allowing both threaded web servers
  8. # and those relying on copy on write to perform better.
  9. # Rake tasks automatically ignore this option for performance.
  10. config.eager_load = true
  11. # Full error reports are disabled and caching is turned on.
  12. config.consider_all_requests_local = false
  13. config.action_controller.perform_caching = true
  14. # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
  15. # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
  16. # config.require_master_key = true
  17. # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
  18. # This disables the ActionDispatch::Static middleware.
  19. config.public_file_server.enabled = false
  20. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  21. # config.asset_host = "http://assets.example.com"
  22. # Specifies the header that your server uses for sending files.
  23. # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
  24. # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
  25. # Assume all access to the app is happening through a SSL-terminating reverse proxy.
  26. # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
  27. # config.assume_ssl = true
  28. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  29. # config.force_ssl = true
  30. # Skip http-to-https redirect for the default health check endpoint.
  31. # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
  32. # Prepend all log lines with the following tags.
  33. config.log_tags = [ :request_id ]
  34. # "info" includes generic and useful information about system operation, but avoids logging too much
  35. # information to avoid inadvertent exposure of personally identifiable information (PII). If you
  36. # want to log everything, set the level to "debug".
  37. config.log_level = :fatal
  38. # Use a different cache store in production.
  39. config.cache_store = :redis_cache_store, {
  40. url: ENV['REDIS_URL'],
  41. connect_timeout: 30, # Defaults to 20 seconds
  42. read_timeout: 0.2, # Defaults to 1 second
  43. write_timeout: 0.2, # Defaults to 1 second
  44. reconnect_attempts: 1, # Defaults to 0
  45. error_handler: -> (method:, returning:, exception:) {
  46. puts "NO REDIS DETECTED"
  47. }
  48. }
  49. # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  50. # the I18n.default_locale when a translation cannot be found).
  51. config.i18n.fallbacks = true
  52. # Don't log any deprecations.
  53. config.active_support.report_deprecations = false
  54. # Do not dump schema after migrations.
  55. config.active_record.dump_schema_after_migration = false
  56. # Enable DNS rebinding protection and other `Host` header attacks.
  57. # config.hosts = [
  58. # "example.com", # Allow requests from example.com
  59. # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
  60. # ]
  61. # Skip DNS rebinding protection for the default health check endpoint.
  62. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
  63. end