Skip to content

Commit b2ad154

Browse files
authored
Replace $host with "$scheme$request_method$host$request_uri"; (hestiacp#2482)
Same as FastCGI cache
1 parent fd42196 commit b2ad154

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

install/deb/nginx/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ http {
128128

129129
# Proxy cache
130130
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
131-
proxy_cache_key "$host$request_uri $cookie_user";
131+
proxy_cache_key "$scheme$request_method$host$request_uri";
132132
proxy_temp_path /var/cache/nginx/temp;
133133
proxy_ignore_headers Expires Cache-Control;
134134
proxy_cache_use_stale error timeout invalid_header http_502;

install/upgrade/versions/1.5.11.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@ fi
4242
if [ -d "/var/log/roundcube" ]; then
4343
chown www-data:www-data /var/log/roundcube
4444
fi
45+
46+
# Fix bug in nginx.conf for proxy cache
47+
if [ -d "/etc/nginx/nginx.conf" ]; then
48+
echo "[ ! ] Fixed an issue with proxy cache and redirects"
49+
sed -i 's/proxy_cache_key "$host$request_uri $cookie_user";/proxy_cache_key "$scheme$request_method$host$request_uri";/g' /etc/nginx/nginx.conf
50+
fi

0 commit comments

Comments
 (0)