summarylogtreecommitdiffstats
path: root/nginx.immich.conf
diff options
context:
space:
mode:
authorpikl2023-11-19 22:11:49 +0000
committerpikl2023-11-19 22:11:49 +0000
commit1d5f5caaad1937cbe4909c1fc921baeda2b920aa (patch)
tree97dbb0e5ef4a7e2db22a658e11d932b727fe76f9 /nginx.immich.conf
parent344fcb1470cb321fc8316c2ec2009971395d96ba (diff)
downloadaur-1d5f5caaad1937cbe4909c1fc921baeda2b920aa.tar.gz
bump v1.87.0
Diffstat (limited to 'nginx.immich.conf')
-rw-r--r--nginx.immich.conf155
1 files changed, 71 insertions, 84 deletions
diff --git a/nginx.immich.conf b/nginx.immich.conf
index d6a1cd74ff03..a4af11b62912 100644
--- a/nginx.immich.conf
+++ b/nginx.immich.conf
@@ -1,92 +1,79 @@
-# NOTE: This file is generated on startup. See /start.sh
-worker_processes auto;
-error_log /var/log/nginx/error.log;
-pid /tmp/nginx.pid;
+# adapted from https://github.com/immich-app/immich/blob/main/nginx/templates/default.conf.template
-# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
-include /usr/share/nginx/modules/*.conf;
+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;
+}
-events {
- worker_connections 1024;
+upstream server {
+ server localhost:3001;
+ # server ${IMMICH_SERVER_HOST};
+ keepalive 2;
}
-http {
- map $http_upgrade $connection_upgrade {
- default upgrade;
- '' close;
+upstream web {
+ server localhost:3000;
+ # server ${IMMICH_WEB_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 /api {
+
+ rewrite /api/(.*) /$1 break;
+
+ proxy_pass http://server;
+ # proxy_pass ${IMMICH_SERVER_SCHEME}server;
}
- client_body_temp_path /tmp/client_temp;
- proxy_temp_path /tmp/proxy_temp_path;
- fastcgi_temp_path /tmp/fastcgi_temp;
- uwsgi_temp_path /tmp/uwsgi_temp;
- scgi_temp_path /tmp/scgi_temp;
-
- # events {
- # worker_connections 1000;
- # }
-
- server {
-
- gzip on;
- gzip_min_length 1000;
- gunzip on;
-
- client_max_body_size 50000M;
-
- listen 8080;
- access_log off;
-
- location /api {
-
- # Compression
- gzip_static on;
- gzip_min_length 1000;
- gzip_comp_level 2;
-
- proxy_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 $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;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $host;
-
- rewrite /api/(.*) /$1 break;
-
- proxy_pass http://localhost:3001;
- }
-
- location / {
-
- # Compression
- gzip_static on;
- gzip_min_length 1000;
- gzip_comp_level 2;
-
- proxy_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 $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;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header Host $host;
-
- proxy_pass http://localhost:3000;
- }
+ location / {
+
+ proxy_pass http://web;
+ # proxy_pass ${IMMICH_WEB_SCHEME}web;
}
}