From 053328be086f40d59e4115eac9d3d945ebca6ebd Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 26 Jun 2018 20:40:48 +0300 Subject: [PATCH] Fix nginx failing to start on certain low-cache CPUs --- roles/matrix-server/tasks/setup_nginx_proxy.yml | 3 ++- .../matrix-server/templates/nginx-conf.d/nginx-http.conf.j2 | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 roles/matrix-server/templates/nginx-conf.d/nginx-http.conf.j2 diff --git a/roles/matrix-server/tasks/setup_nginx_proxy.yml b/roles/matrix-server/tasks/setup_nginx_proxy.yml index 57108064..3ce87493 100644 --- a/roles/matrix-server/tasks/setup_nginx_proxy.yml +++ b/roles/matrix-server/tasks/setup_nginx_proxy.yml @@ -21,12 +21,13 @@ - "{{ matrix_nginx_proxy_data_path }}" - "{{ matrix_nginx_proxy_confd_path }}" -- name: Ensure Matrix Synapse proxy vhost configured +- name: Ensure Matrix nginx-proxy configured template: src: "{{ role_path }}/templates/nginx-conf.d/{{ item }}.j2" dest: "{{ matrix_nginx_proxy_confd_path }}/{{ item }}" mode: 0644 with_items: + - "nginx-http.conf" - "matrix-synapse.conf" - "matrix-riot-web.conf" diff --git a/roles/matrix-server/templates/nginx-conf.d/nginx-http.conf.j2 b/roles/matrix-server/templates/nginx-conf.d/nginx-http.conf.j2 new file mode 100644 index 00000000..ed171cfa --- /dev/null +++ b/roles/matrix-server/templates/nginx-conf.d/nginx-http.conf.j2 @@ -0,0 +1,5 @@ +# The default is aligned to the CPU's cache size, +# which can sometimes be too low to handle our 2 vhosts (Synapse and Riot). +# +# Thus, we ensure a larger bucket size value is used. +server_names_hash_bucket_size 64; \ No newline at end of file