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}"
144
144
echo " Provide Index Pages Enabled: ${PROVIDE_INDEX_PAGE} "
145
145
echo " Append slash for directory enabled: ${APPEND_SLASH_FOR_POSSIBLE_DIRECTORY} "
146
146
echo " 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} "
148
148
echo " CORS Enabled: ${CORS_ENABLED} "
149
149
echo " 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 94
94
export S3_HOST_HEADER=" ${S3_BUCKET_NAME} .${S3_SERVER} "
95
95
fi
96
96
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
97
101
98
102
# Nothing is modified under this line
99
103
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ env PROXY_CACHE_VALID_OK;
38
38
env PROXY_CACHE_SLICE_SIZE;
39
39
env PROXY_CACHE_VALID_NOTFOUND;
40
40
env PROXY_CACHE_VALID_FORBIDDEN;
41
+ env PROXY_CACHE_USE_STALE;
41
42
env HEADER_PREFIXES_TO_STRIP;
42
43
env FOUR_O_FOUR_ON_EMPTY_BUCKET;
43
44
env STRIP_LEADING_DIRECTORY_PATH;
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ server {
56
56
proxy_cache_revalidate on;
57
57
proxy_cache_background_update on;
58
58
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} ;
60
60
proxy_cache_key "$request_method$host$uri";
61
61
62
62
# 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
20
20
PROXY_CACHE_VALID_OK=1h
21
21
PROXY_CACHE_VALID_NOTFOUND=1m
22
22
PROXY_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
20
20
PROXY_CACHE_VALID_OK=1h
21
21
PROXY_CACHE_VALID_NOTFOUND=1m
22
22
PROXY_CACHE_VALID_FORBIDDEN=30s
23
+ PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'
23
24
STRIP_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}"
96
96
echo " Proxy Caching Time for Valid Response: ${PROXY_CACHE_VALID_OK} "
97
97
echo " Proxy Caching Time for Not Found Response: ${PROXY_CACHE_VALID_NOTFOUND} "
98
98
echo " Proxy Caching Time for Forbidden Response: ${PROXY_CACHE_VALID_FORBIDDEN} "
99
+ echo " Proxy Cache Using Stale: ${PROXY_CACHE_USE_STALE} "
99
100
echo " CORS Enabled: ${CORS_ENABLED} "
100
101
echo " CORS Allow Private Network Access: ${CORS_ALLOW_PRIVATE_NETWORK_ACCESS} "
101
102
@@ -179,6 +180,8 @@ PROXY_CACHE_VALID_OK=${PROXY_CACHE_VALID_OK:-'1h'}
179
180
PROXY_CACHE_VALID_NOTFOUND=${PROXY_CACHE_VALID_NOTFOUND:- ' 1m' }
180
181
# Proxy caching time for response code 403
181
182
PROXY_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' }
182
185
# Enables or disables CORS for the S3 Gateway (true=enabled, false=disabled)
183
186
CORS_ENABLED=${CORS_ENABLED:- ' false' }
184
187
# Configure portion of URL to be removed (optional)
You can’t perform that action at this time.
0 commit comments