Skip to content

Commit e5a1c34

Browse files
author
Hadrien Huvelle
committed
[IMP] Added Nginx cache cusomisation capabilities
1 parent 6d69253 commit e5a1c34

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

9.0/docker-entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,13 @@ echo "${NGX_HTPASSWD}" > /etc/nginx/htpasswd
77

88
/usr/local/bin/confd -onetime -backend env
99

10+
if [[ -z "${NGX_SPECIFIC_CACHE}" ]]
11+
then
12+
echo "CREATE empty /etc/nginx/specific_cache.conf"
13+
touch /etc/nginx/specific_cache.conf
14+
else
15+
echo "OVERRIDE /etc/nginx/specific_cache.conf"
16+
echo "${NGX_SPECIFIC_CACHE}" > /etc/nginx/specific_cache.conf
17+
fi
18+
1019
exec "$@"

9.0/templates/nginx.conf.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ http {
7777
proxy_max_temp_file_size 2048m;
7878
proxy_temp_file_write_size 64k;
7979

80-
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m inactive=60m;
80+
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:100m inactive=60m;
8181

8282
include /etc/nginx/proxy_headers.conf;
8383

@@ -148,6 +148,8 @@ http {
148148
try_files =404 @cached;
149149
}
150150

151+
include /etc/nginx/specific_cache.conf;
152+
151153
# warning: /web/content reads ir.attachment, it would not be safe to
152154
# cache other files than .js / .css which can depend on users rights
153155
location ~* ^/web/content/.+\.(js|css)$ {

0 commit comments

Comments
 (0)