File tree Expand file tree Collapse file tree 8 files changed +46
-34
lines changed Expand file tree Collapse file tree 8 files changed +46
-34
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ echo "Directory Listing Path Prefix: ${DIRECTORY_LISTING_PATH_PREFIX}"
144144echo " Provide Index Pages Enabled: ${PROVIDE_INDEX_PAGE} "
145145echo " Append slash for directory enabled: ${APPEND_SLASH_FOR_POSSIBLE_DIRECTORY} "
146146echo " Stripping the following headers from responses: x-amz-;${HEADER_PREFIXES_TO_STRIP} "
147- echo " Allow the following headers from responses (these take precendence over the above): ${HEADER_PREFIXES_ALLOWED} "
147+ echo " Allow the following headers from responses (these take precedence over the above): ${HEADER_PREFIXES_ALLOWED} "
148148echo " CORS Enabled: ${CORS_ENABLED} "
149149echo " CORS Allow Private Network Access: ${CORS_ALLOW_PRIVATE_NETWORK_ACCESS} "
150+ echo " Proxy cache using stale setting: ${PROXY_CACHE_USE_STALE} "
Original file line number Diff line number Diff line change 9494 export S3_HOST_HEADER=" ${S3_BUCKET_NAME} .${S3_SERVER} "
9595fi
9696
97+ # Use default proxy_cache_use_stale settings if the variable is not defined
98+ if [[ ! -v PROXY_CACHE_USE_STALE ]]; then
99+ export PROXY_CACHE_USE_STALE=" error timeout http_500 http_502 http_503 http_504"
100+ fi
97101
98102# Nothing is modified under this line
99103
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ env PROXY_CACHE_VALID_OK;
3838env PROXY_CACHE_SLICE_SIZE;
3939env PROXY_CACHE_VALID_NOTFOUND;
4040env PROXY_CACHE_VALID_FORBIDDEN;
41+ env PROXY_CACHE_USE_STALE;
4142env HEADER_PREFIXES_TO_STRIP;
4243env FOUR_O_FOUR_ON_EMPTY_BUCKET;
4344env STRIP_LEADING_DIRECTORY_PATH;
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ server {
5656 proxy_cache_revalidate on;
5757 proxy_cache_background_update on;
5858 proxy_cache_lock on;
59- proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504 ;
59+ proxy_cache_use_stale ${PROXY_CACHE_USE_STALE} ;
6060 proxy_cache_key "$request_method$host$uri";
6161
6262 # If you need to support proxying range request, refer to this article:
Original file line number Diff line number Diff line change @@ -20,3 +20,4 @@ PROXY_CACHE_INACTIVE=60m
2020PROXY_CACHE_VALID_OK=1h
2121PROXY_CACHE_VALID_NOTFOUND=1m
2222PROXY_CACHE_VALID_FORBIDDEN=30s
23+ PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -20,4 +20,5 @@ PROXY_CACHE_INACTIVE=60m
2020PROXY_CACHE_VALID_OK=1h
2121PROXY_CACHE_VALID_NOTFOUND=1m
2222PROXY_CACHE_VALID_FORBIDDEN=30s
23+ PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'
2324STRIP_LEADING_DIRECTORY_PATH=/somepath
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ echo "Slice of slice for byte range requests: ${PROXY_CACHE_SLICE_SIZE}"
9696echo " Proxy Caching Time for Valid Response: ${PROXY_CACHE_VALID_OK} "
9797echo " Proxy Caching Time for Not Found Response: ${PROXY_CACHE_VALID_NOTFOUND} "
9898echo " Proxy Caching Time for Forbidden Response: ${PROXY_CACHE_VALID_FORBIDDEN} "
99+ echo " Proxy Cache Using Stale: ${PROXY_CACHE_USE_STALE} "
99100echo " CORS Enabled: ${CORS_ENABLED} "
100101echo " CORS Allow Private Network Access: ${CORS_ALLOW_PRIVATE_NETWORK_ACCESS} "
101102
@@ -179,6 +180,8 @@ PROXY_CACHE_VALID_OK=${PROXY_CACHE_VALID_OK:-'1h'}
179180PROXY_CACHE_VALID_NOTFOUND=${PROXY_CACHE_VALID_NOTFOUND:- ' 1m' }
180181# Proxy caching time for response code 403
181182PROXY_CACHE_VALID_FORBIDDEN=${PROXY_CACHE_VALID_FORBIDDEN:- ' 30s' }
183+ # Proxy cache using stale data when error occurs
184+ PROXY_CACHE_USE_STALE=${PROXY_CACHE_USE_STALE:- ' error timeout http_500 http_502 http_503 http_504' }
182185# Enables or disables CORS for the S3 Gateway (true=enabled, false=disabled)
183186CORS_ENABLED=${CORS_ENABLED:- ' false' }
184187# Configure portion of URL to be removed (optional)
You can’t perform that action at this time.
0 commit comments