-
Notifications
You must be signed in to change notification settings - Fork 6
/
imgproxy-nginx-cached.conf
38 lines (28 loc) · 1.29 KB
/
imgproxy-nginx-cached.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Based on https://gist.github.com/DarthSim/ee75da7da21dc984fe5e99ac86509a9f
proxy_cache_path /var/www/cache levels=1:2 keys_zone=imgcache:10m max_size=1000m inactive=30d;
proxy_temp_path /var/www/cache/tmp;
server {
server_name your-domain.com;
listen 443;
client_max_body_size 8M;
ssl on;
ssl_certificate /path/to/your/cert.crt;
ssl_certificate_key /path/to/your/cert.key;
keepalive_timeout 60;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2;
ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS_AES_256_GCM_SHA384:TLS-AES-256-GCM-SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS-CHACHA20-POLY1305-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA;
ssl_prefer_server_ciphers on;
location / {
proxy_cache imgcache;
proxy_cache_valid 200 30d;
proxy_cache_valid 404 1m;
if ($http_accept ~* "webp") {
set $webp WEBP;
}
proxy_cache_key $scheme$proxy_host$request_uri$webp;
proxy_pass "http://127.0.0.1:8080";
proxy_next_upstream error timeout invalid_header;
proxy_redirect off;
}
}