production.rb 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 for better performance and memory savings (ignored by Rake tasks).
  7. config.eager_load = true
  8. # Full error reports are disabled.
  9. config.consider_all_requests_local = false
  10. # Turn on fragment caching in view templates.
  11. config.action_controller.perform_caching = true
  12. # Cache assets for far-future expiry since they are all digest stamped.
  13. config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
  14. # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
  15. # This disables the ActionDispatch::Static middleware.
  16. config.public_file_server.enabled = false
  17. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  18. # config.asset_host = "http://assets.example.com"
  19. # Assume all access to the app is happening through a SSL-terminating reverse proxy.
  20. # config.assume_ssl = true
  21. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  22. # config.force_ssl = true
  23. # Skip http-to-https redirect for the default health check endpoint.
  24. # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
  25. # Log to STDOUT with the current request id as a default log tag.
  26. # config.log_tags = [ :request_id ]
  27. config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
  28. # Change to "debug" to log everything (including potentially personally-identifiable information!)
  29. config.log_level = :fatal
  30. # Prevent health checks from clogging up the logs.
  31. config.silence_healthcheck_path = "/up"
  32. # Don't log any deprecations.
  33. config.active_support.report_deprecations = false
  34. # Use a different cache store in production.
  35. config.cache_store = :redis_cache_store, {
  36. url: ENV['REDIS_URL'],
  37. connect_timeout: 30, # Defaults to 20 seconds
  38. read_timeout: 0.2, # Defaults to 1 second
  39. write_timeout: 0.2, # Defaults to 1 second
  40. reconnect_attempts: 1, # Defaults to 0
  41. error_handler: -> (method:, returning:, exception:) {
  42. puts "NO REDIS DETECTED"
  43. }
  44. }
  45. # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  46. # the I18n.default_locale when a translation cannot be found).
  47. config.i18n.fallbacks = true
  48. # Do not dump schema after migrations.
  49. config.active_record.dump_schema_after_migration = false
  50. # Only use :id for inspections in production.
  51. config.active_record.attributes_for_inspect = [ :id ]
  52. # Enable DNS rebinding protection and other `Host` header attacks.
  53. # config.hosts = [
  54. # "example.com", # Allow requests from example.com
  55. # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
  56. # ]
  57. #
  58. # Skip DNS rebinding protection for the default health check endpoint.
  59. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
  60. end