Skip to content

Commit e928452

Browse files
committed
Merge remote-tracking branch 'origin/nginx-plus-base-image' into nginx-plus-base-image
# Conflicts: # Dockerfile.plus
2 parents 09ecff2 + 62504e6 commit e928452

File tree

8 files changed

+46
-34
lines changed

8 files changed

+46
-34
lines changed

common/docker-entrypoint.d/00-check-for-required-env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ echo "Directory Listing Path Prefix: ${DIRECTORY_LISTING_PATH_PREFIX}"
144144
echo "Provide Index Pages Enabled: ${PROVIDE_INDEX_PAGE}"
145145
echo "Append slash for directory enabled: ${APPEND_SLASH_FOR_POSSIBLE_DIRECTORY}"
146146
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}"
148148
echo "CORS Enabled: ${CORS_ENABLED}"
149149
echo "CORS Allow Private Network Access: ${CORS_ALLOW_PRIVATE_NETWORK_ACCESS}"
150+
echo "Proxy cache using stale setting: ${PROXY_CACHE_USE_STALE}"

common/docker-entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ else
9494
export S3_HOST_HEADER="${S3_BUCKET_NAME}.${S3_SERVER}"
9595
fi
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

common/etc/nginx/nginx.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ env PROXY_CACHE_VALID_OK;
3838
env PROXY_CACHE_SLICE_SIZE;
3939
env PROXY_CACHE_VALID_NOTFOUND;
4040
env PROXY_CACHE_VALID_FORBIDDEN;
41+
env PROXY_CACHE_USE_STALE;
4142
env HEADER_PREFIXES_TO_STRIP;
4243
env FOUR_O_FOUR_ON_EMPTY_BUCKET;
4344
env STRIP_LEADING_DIRECTORY_PATH;

common/etc/nginx/templates/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:

deployments/s3_express/settings.s3express.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ PROXY_CACHE_INACTIVE=60m
2020
PROXY_CACHE_VALID_OK=1h
2121
PROXY_CACHE_VALID_NOTFOUND=1m
2222
PROXY_CACHE_VALID_FORBIDDEN=30s
23+
PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'

docs/getting_started.md

Lines changed: 33 additions & 32 deletions
Large diffs are not rendered by default.

settings.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ PROXY_CACHE_INACTIVE=60m
2020
PROXY_CACHE_VALID_OK=1h
2121
PROXY_CACHE_VALID_NOTFOUND=1m
2222
PROXY_CACHE_VALID_FORBIDDEN=30s
23+
PROXY_CACHE_USE_STALE='error timeout http_500 http_502 http_503 http_504'
2324
STRIP_LEADING_DIRECTORY_PATH=/somepath

standalone_ubuntu_oss_install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ echo "Slice of slice for byte range requests: ${PROXY_CACHE_SLICE_SIZE}"
9696
echo "Proxy Caching Time for Valid Response: ${PROXY_CACHE_VALID_OK}"
9797
echo "Proxy Caching Time for Not Found Response: ${PROXY_CACHE_VALID_NOTFOUND}"
9898
echo "Proxy Caching Time for Forbidden Response: ${PROXY_CACHE_VALID_FORBIDDEN}"
99+
echo "Proxy Cache Using Stale: ${PROXY_CACHE_USE_STALE}"
99100
echo "CORS Enabled: ${CORS_ENABLED}"
100101
echo "CORS Allow Private Network Access: ${CORS_ALLOW_PRIVATE_NETWORK_ACCESS}"
101102

@@ -179,6 +180,8 @@ PROXY_CACHE_VALID_OK=${PROXY_CACHE_VALID_OK:-'1h'}
179180
PROXY_CACHE_VALID_NOTFOUND=${PROXY_CACHE_VALID_NOTFOUND:-'1m'}
180181
# Proxy caching time for response code 403
181182
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'}
182185
# Enables or disables CORS for the S3 Gateway (true=enabled, false=disabled)
183186
CORS_ENABLED=${CORS_ENABLED:-'false'}
184187
# Configure portion of URL to be removed (optional)

0 commit comments

Comments
 (0)