-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
30 lines (26 loc) · 1.07 KB
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# This file is used by Rack-based servers to start the application.
require_relative '../deployment'
# Ensure all application secrets are loaded.
CDO.cdo_secrets&.required! unless rack_env?(:development)
require File.expand_path('../config/environment', __FILE__)
unless rack_env?(:development)
require 'cdo/app_server_metrics'
listener = CDO.dashboard_sock || "0.0.0.0:#{CDO.dashboard_port}"
use Cdo::AppServerMetrics,
listeners: [listener],
dimensions: {
Environment: CDO.rack_env,
Host: CDO.dashboard_hostname
}
end
use Rack::ContentLength
require 'rack/ssl-enforcer'
use Rack::SslEnforcer,
# Add HSTS header to all HTTPS responses in all environments.
hsts: {expires: 31_536_000, subdomains: false},
# HTTPS redirect is handled at the HTTP-cache layer (CloudFront/Varnish).
# The only exception is in :development, where no HTTP-cache layer is present.
only_environments: 'development',
# Only HTTPS-redirect in development when `https_development` is true.
ignore: ->(request) {!request.ssl? && !CDO.https_development}
run Rails.application