+# DO NOT EDIT - This file is being maintained by Chef
+
upstream tile_cache_backend {
server 127.0.0.1;
<% @caches.each do |cache| -%>
keepalive 32;
}
-# Rates table based on cookie value
+# Rates table based on current cookie value
map $cookie_qos_token $limit_rate_qos {
- default 8192; # Default Rate
- "test" 32768; # FIXME - Future TOTP Token
+ include /etc/nginx/conf.d/tile_qos_rates.map;
}
+# Set-Cookie table based on current cookie value
map $cookie_qos_token $cookie_qos_token_set {
- # Cookie Domain per RFC 6265
- default 'qos_token=test; Secure; httponly; Max-Age=3600; Domain=tile.openstreetmap.org; Path=/'; # FIXME - Future TOTP Token
- "test" ''; # Do not Set-Cookie if current is valid
+ include /etc/nginx/conf.d/tile_qos_cookies.map;
}
map $http_user_agent $approved_scraper {
proxy_buffers 8 64k;
- ssl_certificate /etc/ssl/certs/<%= @certificate %>.pem;
- ssl_certificate_key /etc/ssl/private/<%= @certificate %>.key;
-
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_ciphers <%= node[:ssl][:ciphers] -%>;
- ssl_prefer_server_ciphers on;
- ssl_session_cache shared:SSL:50m;
- ssl_session_timeout 30m;
- ssl_stapling on;
- ssl_dhparam /etc/ssl/certs/dhparam.pem;
- resolver <%= @resolvers.join(" ") %>;
- resolver_timeout 5s;
+ ssl_certificate /etc/ssl/certs/tile.openstreetmap.org.pem;
+ ssl_certificate_key /etc/ssl/private/tile.openstreetmap.org.key;
location / {
proxy_pass http://tile_cache_backend;
# Set a QoS cookie if none presented (uses nginx Map)
add_header Set-Cookie $cookie_qos_token_set;
+<% if node[:ssl][:strict_transport_security] -%>
+
+ # Enable HSTS
+ add_header Strict-Transport-Security "<%= node[:ssl][:strict_transport_security] %>" always;
+<% end -%>
# QoS Traffic Rate see $limit_rate on http://nginx.org/en/docs/http/ngx_http_core_module.html
set $limit_rate $limit_rate_qos;