expose custom x-total-count header

This commit is contained in:
Mononaut 2024-09-27 15:55:29 +00:00
parent 676abf58fd
commit b26d26b14c
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -92,6 +92,7 @@ location @mempool-api-v1-services-cache-disabled-addcors {
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
set $cors_origin 'https://mempool.space';
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
set $cors_expose_headers 'X-Total-Count';
set $cors_credentials 'true';
# set CORS for approved hostnames
@ -100,6 +101,7 @@ location @mempool-api-v1-services-cache-disabled-addcors {
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
set $cors_origin "$http_origin";
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
set $cors_expose_headers 'X-Total-Count';
set $cors_credentials 'true';
}
@ -108,6 +110,7 @@ location @mempool-api-v1-services-cache-disabled-addcors {
add_header Access-Control-Allow-Origin "$cors_origin" always;
add_header Access-Control-Allow-Headers "$cors_headers" always;
add_header Access-Control-Allow-Credentials "$cors_credentials" always;
add_header Access-Control-Expose-Headers "$cors_expose_headers" always;
proxy_redirect off;
proxy_buffering off;
@ -172,6 +175,7 @@ location @mempool-api-v1-services-cache-short-addcors {
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
set $cors_origin 'https://mempool.space';
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
set $cors_expose_headers 'X-Total-Count';
set $cors_credentials 'true';
# set CORS for approved hostnames
@ -180,6 +184,7 @@ location @mempool-api-v1-services-cache-short-addcors {
set $cors_methods 'GET, POST, PUT, DELETE, OPTIONS';
set $cors_origin "$http_origin";
set $cors_headers 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With';
set $cors_expose_headers 'X-Total-Count';
set $cors_credentials 'true';
}
@ -188,6 +193,7 @@ location @mempool-api-v1-services-cache-short-addcors {
add_header Access-Control-Allow-Origin "$cors_origin" always;
add_header Access-Control-Allow-Headers "$cors_headers" always;
add_header Access-Control-Allow-Credentials "$cors_credentials" always;
add_header Access-Control-Expose-Headers "$cors_expose_headers" always;
# add our own cache headers
add_header 'Pragma' 'public';