records.config.jinja2 13 KB
Newer Older
1
##############################################################################
2
# *NOTE*: All options covered in this file should be documented in the docs:
3
#
4 5 6 7
#    https://docs.trafficserver.apache.org/records.config
##############################################################################

##############################################################################
8
# SlapOS Specific configuration not available in default records.config
9 10
##############################################################################
CONFIG proxy.config.proxy_name STRING {{ ats_configuration['hostname'] }}
11
CONFIG proxy.config.local_state_dir STRING {{ ats_directory['local-state'] }}
12 13 14 15
CONFIG proxy.config.bin_path STRING {{ ats_directory['bin_path'] }}
CONFIG proxy.config.env_prep STRING example_prep.sh
CONFIG proxy.config.syslog_facility STRING LOG_DAEMON
CONFIG proxy.config.output.logfile STRING traffic.out
16 17 18
CONFIG proxy.config.admin.user_id STRING {{ '#%s' % os_module.geteuid() }}
LOCAL proxy.local.incoming_ip_to_bind STRING {{ ats_configuration['local-ip'] }}
CONFIG proxy.config.log.logfile_dir STRING {{ ats_directory['log'] }}
19 20
# Never change Server header
CONFIG proxy.config.http.response_server_enabled INT 0
21 22 23 24 25 26
# Handle Via header
CONFIG proxy.config.http.insert_request_via_str INT 1
CONFIG proxy.config.http.request_via_str STRING rapid-cdn-cache-{{ ats_configuration['node-id'] }}-{{ ats_configuration['version-hash'] }}
CONFIG proxy.config.http.insert_response_via_str INT 1
CONFIG proxy.config.http.response_via_str STRING rapid-cdn-cache-{{ ats_configuration['node-id'] }}-{{ ats_configuration['version-hash'] }}

27 28 29
# Implement RFC 5861 with core
CONFIG proxy.config.http.cache.open_write_fail_action INT 2
CONFIG proxy.config.body_factory.template_sets_dir STRING  {{ ats_configuration['templates-dir'] }}
30 31 32 33
# Simulate stale-if-error (not supported by TrafficServer), by using internal
# mechanism
# This results with replying last know non-5xx response until max_stale_age is reached
# ignoring max-age returned by the server 
34
CONFIG proxy.config.http.negative_revalidating_enabled INT 1
35 36 37 38 39 40 41 42
# max_stale_age set here means that for 1 week since last correct response
# the response will be sent by the system
CONFIG proxy.config.http.cache.max_stale_age INT 604800
# negative_revalidating_lifetime just adds Expires header calculated as
#          Expires = Date + negative_revalidating_lifetime
# for case when backend replies 5xx, and Age > max-age and Age < max_stale_age
# and that's not needed, so drop this behaviour
CONFIG proxy.config.http.negative_revalidating_lifetime INT 0
43

44
##############################################################################
45 46
# Thread configurations. Docs:
#    https://docs.trafficserver.apache.org/records.config#thread-variables
47 48 49 50 51
##############################################################################
CONFIG proxy.config.exec_thread.autoconfig INT 1
CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 1.5
CONFIG proxy.config.exec_thread.limit INT 2
CONFIG proxy.config.accept_threads INT 1
52 53 54 55
CONFIG proxy.config.task_threads INT 2
CONFIG proxy.config.cache.threads_per_disk INT 8
CONFIG proxy.config.exec_thread.affinity INT 1

56
##############################################################################
57 58
# Specify server addresses and ports to bind for HTTP and HTTPS. Docs:
#    https://docs.trafficserver.apache.org/records.config#proxy.config.http.server_ports
59
##############################################################################
60 61
CONFIG proxy.config.http.server_ports STRING {{ ats_configuration['local-ip'] + ':' + ats_configuration['input-port'] }}

62
##############################################################################
63 64 65
# Parent proxy configuration, in addition to these settings also see parent.config. Docs:
#    https://docs.trafficserver.apache.org/records.config#parent-proxy-configuration
#    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/parent.config.en.html
66 67 68 69
##############################################################################
CONFIG proxy.config.http.parent_proxy.retry_time INT 300
CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 30
CONFIG proxy.config.http.forward.proxy_auth_to_parent INT 0
70 71 72 73 74 75 76
CONFIG proxy.config.http.uncacheable_requests_bypass_parent INT 1

##############################################################################
# HTTP connection timeouts (secs). Docs:
#    https://docs.trafficserver.apache.org/records.config#http-connection-timeouts
##############################################################################
CONFIG proxy.config.http.keep_alive_no_activity_timeout_in INT 120
77
CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 120
78
CONFIG proxy.config.http.transaction_no_activity_timeout_in INT {{ ats_configuration['request-timeout'] }}
79
CONFIG proxy.config.http.transaction_no_activity_timeout_out INT {{ ats_configuration['request-timeout'] }}
80 81 82
CONFIG proxy.config.http.transaction_active_timeout_in INT 900
CONFIG proxy.config.http.transaction_active_timeout_out INT 0
CONFIG proxy.config.http.accept_no_activity_timeout INT 120
83 84 85 86 87 88
CONFIG proxy.config.net.default_inactivity_timeout INT 86400

##############################################################################
# Origin server connect attempts. Docs:
#    https://docs.trafficserver.apache.org/records.config#origin-server-connect-attempts
##############################################################################
89 90 91
# workaround for lost connection to haproxy by reconnecting
CONFIG proxy.config.http.connect_attempts_max_retries INT 3
CONFIG proxy.config.http.connect_attempts_max_retries_dead_server INT 1
92
CONFIG proxy.config.http.connect_attempts_rr_retries INT 3
93 94
CONFIG proxy.config.http.connect_attempts_timeout INT {{ ats_configuration['request-timeout'] }}
CONFIG proxy.config.http.post_connect_attempts_timeout INT {{ ats_configuration['request-timeout'] }}
95
CONFIG proxy.config.http.down_server.cache_time INT 60
96
CONFIG proxy.config.http.down_server.abort_threshold INT 10
97 98 99 100 101

##############################################################################
# Negative response caching, for redirects and errors. Docs:
#    https://docs.trafficserver.apache.org/records.config#negative-response-caching
##############################################################################
102 103
CONFIG proxy.config.http.negative_caching_enabled INT 0
CONFIG proxy.config.http.negative_caching_lifetime INT 1800
104

105 106 107 108 109 110 111
##############################################################################
# Proxy users variables. Docs:
#    https://docs.trafficserver.apache.org/records.config#proxy-user-variables
##############################################################################
CONFIG proxy.config.http.insert_client_ip INT 0
CONFIG proxy.config.http.insert_squid_x_forwarded_for INT 0

112 113 114 115 116
##############################################################################
# Security. Docs:
#    https://docs.trafficserver.apache.org/records.config#security
##############################################################################
CONFIG proxy.config.http.push_method_enabled INT 0
117

118 119 120 121
##############################################################################
# Enable / disable HTTP caching. Useful for testing, but also as an
# overridable (per remap) config
##############################################################################
122
CONFIG proxy.config.http.cache.http INT 1
123 124 125 126 127 128 129

##############################################################################
# Cache control. Docs:
#    https://docs.trafficserver.apache.org/records.config#cache-control
#    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/cache.config.en.html
##############################################################################
CONFIG proxy.config.http.cache.ignore_client_cc_max_age INT 1
130
CONFIG proxy.config.http.normalize_ae INT 0
131 132
CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1
CONFIG proxy.config.http.cache.cache_urls_that_look_dynamic INT 1
133
    # https://docs.trafficserver.apache.org/records.config#proxy-config-http-cache-when-to-revalidate
134
CONFIG proxy.config.http.cache.when_to_revalidate INT 0
135
    # https://docs.trafficserver.apache.org/records.config#proxy-config-http-cache-required-headers
136
CONFIG proxy.config.http.cache.required_headers INT 2
137 138 139 140 141

##############################################################################
# Heuristic cache expiration. Docs:
#    https://docs.trafficserver.apache.org/records.config#heuristic-expiration
##############################################################################
142 143 144 145 146
CONFIG proxy.config.http.cache.heuristic_min_lifetime INT 3600
CONFIG proxy.config.http.cache.heuristic_max_lifetime INT 86400
CONFIG proxy.config.http.cache.heuristic_lm_factor FLOAT 0.10

##############################################################################
147 148
# Network. Docs:
#    https://docs.trafficserver.apache.org/records.config#network
149 150
##############################################################################
CONFIG proxy.config.net.connections_throttle INT 30000
151
CONFIG proxy.config.net.max_connections_in INT 30000
152
CONFIG proxy.config.net.max_requests_in INT 10000
153

154
##############################################################################
155 156 157
# RAM and disk cache configurations. Docs:
#    https://docs.trafficserver.apache.org/records.config#ram-cache
#    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/storage.config.en.html
158 159
##############################################################################
CONFIG proxy.config.cache.ram_cache.size INT {{ ats_configuration.get('ram-cache-size', '1G') }}
160 161
CONFIG proxy.config.cache.ram_cache_cutoff INT 4194304
    # https://docs.trafficserver.apache.org/records.config#proxy-config-cache-limits-http-max-alts
162
CONFIG proxy.config.cache.limits.http.max_alts INT 5
163
    # https://docs.trafficserver.apache.org/records.config#proxy-config-cache-max-doc-size
164
CONFIG proxy.config.cache.max_doc_size INT 0
165 166
CONFIG proxy.config.cache.min_average_object_size INT 8000

167
##############################################################################
168 169
# Logging Config. Docs:
#    https://docs.trafficserver.apache.org/records.config#logging-configuration
170
#    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/logging.yaml.en.html
171 172 173 174 175 176 177 178
##############################################################################
CONFIG proxy.config.log.logging_enabled INT 3
CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
CONFIG proxy.config.log.max_space_mb_headroom INT 1000
CONFIG proxy.config.log.rolling_enabled INT 1
CONFIG proxy.config.log.rolling_interval_sec INT 86400
CONFIG proxy.config.log.rolling_size_mb INT 10
CONFIG proxy.config.log.auto_delete_rolled_files INT 1
179 180
CONFIG proxy.config.log.periodic_tasks_interval INT 5

181
##############################################################################
182 183 184
# These settings control remapping, and if the proxy allows (open) forward proxy or not. Docs:
#    https://docs.trafficserver.apache.org/records.config#url-remap-rules
#    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/remap.config.en.html
185 186
##############################################################################
CONFIG proxy.config.url_remap.remap_required INT 1
187
    # https://docs.trafficserver.apache.org/records.config#proxy-config-url-remap-pristine-host-hdr
188
CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
189 190 191
    # https://docs.trafficserver.apache.org/records.config#reverse-proxy
CONFIG proxy.config.reverse_proxy.enabled INT 1

192
##############################################################################
193 194 195
# SSL Termination. Docs:
#    https://docs.trafficserver.apache.org/records.config#client-related-configuration
#    https://docs.trafficserver.apache.org/en/latest/admin-guide/files/ssl_multicert.config.en.html
196
##############################################################################
197
CONFIG proxy.config.ssl.client.verify.server.properties STRING NONE
198
CONFIG proxy.config.ssl.client.CA.cert.filename STRING NULL
199
CONFIG proxy.config.ssl.server.cipher_suite STRING ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
200

201
##############################################################################
202 203
# Debugging. Docs:
#    https://docs.trafficserver.apache.org/records.config#diagnostic-logging-configuration
204 205
##############################################################################
CONFIG proxy.config.diags.debug.enabled INT 0
206
CONFIG proxy.config.diags.debug.tags STRING http|dns
207
# ToDo: Undocumented
208 209
CONFIG proxy.config.dump_mem_info_frequency INT 0
CONFIG proxy.config.http.slow.log.threshold INT 0