summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-07-28 21:23:57 +0300
committerAndrew Dolgov <[email protected]>2023-07-28 21:23:57 +0300
commit3d255d861c1a146c4cae65a8e0e1ae51b19da70a (patch)
tree3103a0768219ca60810668a90381bd65ef3537e9
parentdc25a9cf6816b756cb38490eab93f02589c44a10 (diff)
use nginx envsubst to make tt-rss root configurable
-rw-r--r--.docker/web-nginx/Dockerfile10
-rw-r--r--.docker/web-nginx/nginx.conf7
2 files changed, 13 insertions, 4 deletions
diff --git a/.docker/web-nginx/Dockerfile b/.docker/web-nginx/Dockerfile
index 679323b1c..7f10ed33a 100644
--- a/.docker/web-nginx/Dockerfile
+++ b/.docker/web-nginx/Dockerfile
@@ -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)
diff --git a/.docker/web-nginx/nginx.conf b/.docker/web-nginx/nginx.conf
index f7d47c453..c85e46ef3 100644
--- a/.docker/web-nginx/nginx.conf
+++ b/.docker/web-nginx/nginx.conf
@@ -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;
}