summarylogtreecommitdiffstats
path: root/nginx.immich.conf
blob: d839e2d7cb05ff902e032c16c810f08fcbe787f7 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
# adapted from https://github.com/immich-app/immich/blob/main/nginx/templates/default.conf.template

map $http_upgrade $connection_upgrade {
  default upgrade;
  '' close;
}

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;
}

upstream server {
  server localhost:3001;
  # server ${IMMICH_SERVER_HOST};
  keepalive 2;
}

server {

  listen 8080;

  access_log off;
  client_max_body_size 50000M;

  # Compression
  gzip on;
  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;

  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;

  location / {
    proxy_pass http://server;
    # proxy_pass ${IMMICH_WEB_SCHEME}web;
  }

}