-
Notifications
You must be signed in to change notification settings - Fork 5
/
immich.conf
52 lines (42 loc) · 1.65 KB
/
immich.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
events {}
error_log /dev/stdout info;
http {
access_log /dev/stdout;
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m inactive=60m use_temp_path=off;
server {
listen 80;
server_name _;
send_timeout 100m;
client_max_body_size 1000M;
proxy_http_version 1.1;
proxy_request_buffering off;
fastcgi_request_buffering off;
location / {
proxy_pass $PROXY_HOST; # Replace with your local IP address
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~* \.(jpg|jpeg|png|gif|ico|mp4|mov|m4v|heic|heif)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
proxy_cache my_cache;
proxy_cache_revalidate on;
proxy_cache_min_uses 1;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
# Cache bypass conditions
proxy_cache_bypass $http_cache_control;
proxy_no_cache $http_cache_control;
# Caching related headers
add_header X-Cache-Status $upstream_cache_status;
}
}
# Optional: Gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_vary on;
}