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.
This commit is contained in:
Matias Garcia Isaia 2021-05-28 21:30:51 -03:00 committed by Alejandro Celaya
parent 24801b068b
commit 76ebbd318a

View file

@ -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) { 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; 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 # 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 # This allows HTML5 history paths to be handled by the client application
location / { location / {