use nginx envsubst to make tt-rss root configurable

This commit is contained in:
Andrew Dolgov 2023-07-28 21:23:57 +03:00
parent dc25a9cf68
commit 3d255d861c
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
2 changed files with 13 additions and 4 deletions

View File

@ -8,6 +8,16 @@ COPY nginx.conf /etc/nginx/templates/nginx.conf.template
# name can be overridden at runtime by passing an APP_UPSTREAM env var
ENV APP_UPSTREAM=${APP_UPSTREAM:-app}
# Webroot (defaults to /var/www/html)
ENV APP_WEB_ROOT=${APP_WEB_ROOT:-/var/www/html}
# Base location for tt-rss (defaults to /tt-rss)
ENV APP_BASE=${APP_BASE:-/tt-rss}
# In order to make tt-rss appear on website root without /tt-rss/ set above as follows in .env:
# APP_WEB_ROOT=/var/www/html/tt-rss
# APP_BASE=
# It's necessary to set the following NGINX_ENVSUBST_OUTPUT_DIR env var to tell
# nginx to replace the env vars of /etc/nginx/templates/nginx.conf.template
# and put the result in /etc/nginx/nginx.conf (instead of /etc/nginx/conf.d/nginx.conf)

View File

@ -23,15 +23,14 @@ http {
server {
listen 80;
listen [::]:80;
root ${APP_WEB_ROOT};
root /var/www/html;
location /tt-rss/cache {
location ${APP_BASE}/cache {
aio threads;
internal;
}
location /tt-rss/backups {
location ${APP_BASE}/backups {
internal;
}