From b9e3dc394e1b9cef51db827e5b05bf47d42487ae Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Wed, 23 Oct 2024 23:48:30 +0200 Subject: [PATCH] move styles location block to dynamic --- modules/http_host/http_host_lib/nginx_confs/le.conf | 13 +++++++++++++ .../http_host/http_host_lib/nginx_confs/ledns.conf | 13 +++++++++++++ .../http_host_lib/nginx_confs/location_static.conf | 13 ------------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/modules/http_host/http_host_lib/nginx_confs/le.conf b/modules/http_host/http_host_lib/nginx_confs/le.conf index 9edfff6..4ad7a9f 100644 --- a/modules/http_host/http_host_lib/nginx_confs/le.conf +++ b/modules/http_host/http_host_lib/nginx_confs/le.conf @@ -37,6 +37,19 @@ server { __LOCATION_BLOCKS__ + location /styles/ { + # trailing slash + + alias /data/ofm/http_host/assets/styles/ofm/; # trailing slash + try_files $uri.json =404; + + expires 1d; + default_type application/json; + + add_header 'Access-Control-Allow-Origin' '*' always; + add_header Cache-Control public; + } + # catch-all block to deny all other requests location / { deny all; diff --git a/modules/http_host/http_host_lib/nginx_confs/ledns.conf b/modules/http_host/http_host_lib/nginx_confs/ledns.conf index 67fc295..c7ff0d7 100644 --- a/modules/http_host/http_host_lib/nginx_confs/ledns.conf +++ b/modules/http_host/http_host_lib/nginx_confs/ledns.conf @@ -31,6 +31,19 @@ server { __LOCATION_BLOCKS__ + location /styles/ { + # trailing slash + + alias /data/ofm/http_host/assets/styles/ofm/; # trailing slash + try_files $uri.json =404; + + expires 1d; + default_type application/json; + + add_header 'Access-Control-Allow-Origin' '*' always; + add_header Cache-Control public; + } + # catch-all block to deny all other requests location / { deny all; diff --git a/modules/http_host/http_host_lib/nginx_confs/location_static.conf b/modules/http_host/http_host_lib/nginx_confs/location_static.conf index 3b4bfa1..c7075d5 100644 --- a/modules/http_host/http_host_lib/nginx_confs/location_static.conf +++ b/modules/http_host/http_host_lib/nginx_confs/location_static.conf @@ -10,19 +10,6 @@ location /fonts/ { add_header Cache-Control public; } -location /styles/ { - # trailing slash - - alias /data/ofm/http_host/assets/styles/ofm/; # trailing slash - try_files $uri.json =404; - - expires 1d; - default_type application/json; - - add_header 'Access-Control-Allow-Origin' '*' always; - add_header Cache-Control public; -} - location /natural_earth/ { # trailing slash