2023-02-15 21:21:52 +00:00
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
|
|
|
|
2023-03-22 20:46:30 +00:00
|
|
|
map $http_x_forwarded_proto $forwarded_protocol {
|
|
|
|
default $scheme;
|
|
|
|
|
|
|
|
# Only allow the values 'http' and 'https' for the X-Forwarded-Proto header.
|
|
|
|
http http;
|
|
|
|
https https;
|
|
|
|
}
|
|
|
|
|
2023-02-15 21:21:52 +00:00
|
|
|
upstream server {
|
|
|
|
server ${IMMICH_SERVER_HOST};
|
|
|
|
keepalive 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
upstream web {
|
|
|
|
server ${IMMICH_WEB_HOST};
|
|
|
|
keepalive 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 8080;
|
|
|
|
|
|
|
|
access_log off;
|
|
|
|
client_max_body_size 50000M;
|
|
|
|
|
|
|
|
# Compression
|
2023-05-21 13:23:46 +00:00
|
|
|
gzip on;
|
2023-02-15 21:21:52 +00:00
|
|
|
gzip_comp_level 2;
|
|
|
|
gzip_min_length 1000;
|
|
|
|
gzip_proxied any;
|
|
|
|
gzip_vary on;
|
|
|
|
gunzip on;
|
|
|
|
|
|
|
|
# text/html is included by default
|
|
|
|
gzip_types
|
|
|
|
application/javascript
|
|
|
|
application/json
|
|
|
|
font/ttf
|
|
|
|
image/svg+xml
|
|
|
|
text/css;
|
|
|
|
|
2023-04-13 20:38:49 +00:00
|
|
|
proxy_buffering off;
|
|
|
|
proxy_request_buffering off;
|
|
|
|
proxy_buffer_size 16k;
|
|
|
|
proxy_busy_buffers_size 24k;
|
|
|
|
proxy_buffers 64 4k;
|
|
|
|
proxy_force_ranges on;
|
|
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $forwarded_protocol;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
2023-02-15 21:21:52 +00:00
|
|
|
|
2023-04-13 20:38:49 +00:00
|
|
|
location /api {
|
2023-02-15 21:21:52 +00:00
|
|
|
|
|
|
|
rewrite /api/(.*) /$1 break;
|
|
|
|
|
|
|
|
proxy_pass ${IMMICH_SERVER_SCHEME}server;
|
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
|
|
|
proxy_pass ${IMMICH_WEB_SCHEME}web;
|
|
|
|
}
|
|
|
|
}
|