feat(nginx): Enable upstream keepalive (#1206)

* Enable keepalive

* Adapt envsubst

* Fix shellcheck issues

* Lower connection count
This commit is contained in:
otbutz
2022-12-30 03:09:38 +01:00
committed by GitHub
parent 10b0924cfb
commit b584185f0f
2 changed files with 21 additions and 3 deletions

View File

@@ -26,6 +26,16 @@ http {
# worker_connections 1000;
# }
upstream server {
server $IMMICH_SERVER_HOST
keepalive 2
}
upstream web {
server $IMMICH_WEB_HOST
keepalive 2
}
server {
gzip on;
@@ -61,7 +71,7 @@ http {
rewrite /api/(.*) /$1 break;
proxy_pass $IMMICH_SERVER_URL;
proxy_pass ${IMMICH_SERVER_SCHEME}server;
}
location / {
@@ -86,7 +96,7 @@ http {
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_pass $IMMICH_WEB_URL;
proxy_pass ${IMMICH_WEB_SCHEME}web;
}
}
}