Skip to content

Commit 1f6f429

Browse files
committed
feat(router): support customized server_names_hash_bucket_size setting
Long domain names have trouble with the default settings for server_names_hash_bucket_size and server_names_hash_max_size. This commit makes these settings configurable based on etcd keys. See http://nginx.org/en/docs/http/server_names.html for details on these settings.
1 parent 3c2f11f commit 1f6f429

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

docs/customizing_deis/router_settings.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ setting description
5555
/deis/router/gzipVary nginx gzipVary setting (default: on)
5656
/deis/router/gzipDisable nginx gzipDisable setting (default: "msie6")
5757
/deis/router/gzipTypes nginx gzipTypes setting (default: "application/x-javascript application/xhtml+xml application/xml application/xml+rss application/json text/css text/javascript text/plain text/xml")
58+
/deis/router/serverNameHashMaxSize nginx server_names_hash_max_size setting (default: 512)
59+
/deis/router/serverNameHashBucketSize nginx server_names_hash_bucket_size (default: 64)
5860
/deis/router/sslCert cluster-wide SSL certificate
5961
/deis/router/sslKey cluster-wide SSL private key
6062
/deis/services/* healthy application containers reported by deis/publisher

router/templates/nginx.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ http {
1616
tcp_nopush on;
1717
tcp_nodelay on;
1818
keepalive_timeout 65;
19+
1920
types_hash_max_size 2048;
20-
server_names_hash_bucket_size 64;
21+
server_names_hash_max_size {{ or (.deis_router_serverNameHashMaxSize) "512" }};
22+
server_names_hash_bucket_size {{ or (.deis_router_serverNameHashBucketSize) "64" }};
2123

2224
include /opt/nginx/conf/mime.types;
2325
default_type application/octet-stream;

0 commit comments

Comments
 (0)