From ac21570aa3468a316b747cfbd8241ccdfe6039b3 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 19 Feb 2025 01:46:25 +0800 Subject: feat(2fa): move to root domain subpath. --- templates/docker-compose.yaml.template | 3 ++- templates/nginx/conf.d/2fa.conf.template | 17 ----------------- templates/nginx/conf.d/root.conf.template | 5 +++++ 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 templates/nginx/conf.d/2fa.conf.template diff --git a/templates/docker-compose.yaml.template b/templates/docker-compose.yaml.template index 532585b..fdf0d11 100644 --- a/templates/docker-compose.yaml.template +++ b/templates/docker-compose.yaml.template @@ -169,7 +169,8 @@ services: - APP_TIMEZONE=UTC - SITE_OWNER=crupest@crupest.life - APP_KEY=${CRUPEST_2FAUTH_APP_KEY} - - APP_URL=https://2fa.${CRUPEST_DOMAIN} + - APP_URL=https://${CRUPEST_DOMAIN}/2fa + - APP_SUBDIRECTORY=2fa - MAIL_MAILER=smtp - MAIL_HOST=mail.crupest.life - MAIL_PORT=465 diff --git a/templates/nginx/conf.d/2fa.conf.template b/templates/nginx/conf.d/2fa.conf.template deleted file mode 100644 index 278e4a1..0000000 --- a/templates/nginx/conf.d/2fa.conf.template +++ /dev/null @@ -1,17 +0,0 @@ -server { - server_name 2fa.${CRUPEST_DOMAIN}; - include common/https-listen; - - location / { - include common/proxy-common; - proxy_pass http://2fauth:8000/; - } -} - -server { - server_name 2fa.${CRUPEST_DOMAIN}; - include common/http-listen; - - include common/https-redirect; - include common/acme-challenge; -} diff --git a/templates/nginx/conf.d/root.conf.template b/templates/nginx/conf.d/root.conf.template index a0b08f8..b5f12ef 100644 --- a/templates/nginx/conf.d/root.conf.template +++ b/templates/nginx/conf.d/root.conf.template @@ -6,6 +6,11 @@ server { root /srv/www; } + location /2fa/ { + include common/proxy-common; + proxy_pass http://2fauth:8000/; + } + location /_$CRUPEST_V2RAY_PATH { if ($http_upgrade != "websocket") { return 404; -- cgit v1.2.3