From 76ebbd318a96b5acc44bbec1b7bba1fd8008f321 Mon Sep 17 00:00:00 2001 From: Matias Garcia Isaia Date: Fri, 28 May 2021 21:30:51 -0300 Subject: [PATCH 1/3] Support servers.json in a conf.d directory In Cattle (and maybe other Docker environments) you can't mount specific files, but have to mount a whole volume as a directory. We now allow the servers.json to be looked for inside a specific folder to support that use case. --- config/docker/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/docker/nginx.conf b/config/docker/nginx.conf index 1cb4901f..b76b7175 100644 --- a/config/docker/nginx.conf +++ b/config/docker/nginx.conf @@ -24,6 +24,12 @@ server { location ~* .+\.(css|js|html|png|jpe?g|gif|bmp|ico|json|csv|otf|eot|svg|svgz|ttf|woff|woff2|ijmap|pdf|tif|map) { try_files $uri $uri/ =404; } + + # servers.json may be on the root, or in it's own directory (ie, mounting a volume in Cattle) + location = /servers.json { + try_files /servers.json /conf.d/servers.json; + } + # When requesting a path without extension, try it, and return the index if not found # This allows HTML5 history paths to be handled by the client application location / { From bbc3342c0006f9d9c9e39fab97eb6f57f0798914 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 29 May 2021 11:53:06 +0200 Subject: [PATCH 2/3] Moved servers.json config on nginx above another less restrictive but conflicting rule --- config/docker/nginx.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/docker/nginx.conf b/config/docker/nginx.conf index b76b7175..21276555 100644 --- a/config/docker/nginx.conf +++ b/config/docker/nginx.conf @@ -20,16 +20,16 @@ server { add_header Cache-Control "public"; } + # servers.json may be on the root, or in conf.d directory + location = /servers.json { + try_files /servers.json /conf.d/servers.json; + } + # When requesting static paths with extension, try them, and return a 404 if not found location ~* .+\.(css|js|html|png|jpe?g|gif|bmp|ico|json|csv|otf|eot|svg|svgz|ttf|woff|woff2|ijmap|pdf|tif|map) { try_files $uri $uri/ =404; } - # servers.json may be on the root, or in it's own directory (ie, mounting a volume in Cattle) - location = /servers.json { - try_files /servers.json /conf.d/servers.json; - } - # When requesting a path without extension, try it, and return the index if not found # This allows HTML5 history paths to be handled by the client application location / { From d5fadc56af42c850c77a475f7722a90ac48182a3 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 29 May 2021 11:54:08 +0200 Subject: [PATCH 3/3] Removed new empty line added by mistake --- config/docker/nginx.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/config/docker/nginx.conf b/config/docker/nginx.conf index 21276555..cee606bb 100644 --- a/config/docker/nginx.conf +++ b/config/docker/nginx.conf @@ -29,7 +29,6 @@ server { location ~* .+\.(css|js|html|png|jpe?g|gif|bmp|ico|json|csv|otf|eot|svg|svgz|ttf|woff|woff2|ijmap|pdf|tif|map) { try_files $uri $uri/ =404; } - # When requesting a path without extension, try it, and return the index if not found # This allows HTML5 history paths to be handled by the client application location / {