summaryrefslogtreecommitdiff
path: root/infra/Caddyfile
diff options
context:
space:
mode:
Diffstat (limited to 'infra/Caddyfile')
-rw-r--r--infra/Caddyfile57
1 files changed, 37 insertions, 20 deletions
diff --git a/infra/Caddyfile b/infra/Caddyfile
index 3146529..140101d 100644
--- a/infra/Caddyfile
+++ b/infra/Caddyfile
@@ -13,11 +13,16 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+{
+ http_port {{HTTP_PORT}}
+ https_port {{HTTPS_PORT}}
+}
+
(https_security) {
header >Strict-Transport-Security "max-age=31536000"
}
-luuduct.ai {
+https://{{BASE_DOMAIN}}:{{HTTPS_PORT}} {
import https_security
handle /.well-known/openpgpkey/* {
root * /srv
@@ -26,32 +31,34 @@ luuduct.ai {
}
handle {
- redir https://doan.luuduct.ai{uri} permanent
+ redir {{SITE_ORIGIN}}{uri} permanent
}
}
-www.luuduct.ai {
+https://www.{{BASE_DOMAIN}}:{{HTTPS_PORT}} {
import https_security
- redir https://doan.luuduct.ai{uri} permanent
+ redir {{SITE_ORIGIN}}{uri} permanent
}
-doan.luuduct.ai {
+https://{{SITE_HOST}}:{{HTTPS_PORT}} {
import https_security
+ redir /message {{CHAT_PUBLIC_ORIGIN}}/ permanent
+ redir /message/ {{CHAT_PUBLIC_ORIGIN}}/ permanent
root * /srv
file_server
redir /git /git/
handle /cgit* {
- reverse_proxy cgit:8080
+ reverse_proxy {{CGIT_UPSTREAM}}
}
handle /git/* {
- reverse_proxy cgit:8080
+ reverse_proxy {{CGIT_UPSTREAM}}
}
}
-openpgpkey.luuduct.ai {
+https://{{WKD_HOST}}:{{HTTPS_PORT}} {
import https_security
handle /.well-known/openpgpkey/* {
root * /srv
@@ -60,34 +67,44 @@ openpgpkey.luuduct.ai {
}
}
-git.doan.luuduct.ai {
+https://{{GIT_HOST}}:{{HTTPS_PORT}} {
import https_security
redir /{path}.git /{path} permanent
- reverse_proxy cgit:8080
+ reverse_proxy {{CGIT_UPSTREAM}}
}
-search.doan.luuduct.ai {
+https://{{SEARCH_HOST}}:{{HTTPS_PORT}} {
import https_security
- reverse_proxy searxng:8080
+ reverse_proxy {{SEARXNG_UPSTREAM}}
}
-www.doan.luuduct.ai {
+https://www.{{SITE_HOST}}:{{HTTPS_PORT}} {
import https_security
- redir https://doan.luuduct.ai{uri} permanent
+ redir {{SITE_ORIGIN}}{uri} permanent
}
-www.git.doan.luuduct.ai {
+https://www.{{GIT_HOST}}:{{HTTPS_PORT}} {
import https_security
- redir https://git.doan.luuduct.ai{uri} permanent
+ redir {{GIT_ORIGIN}}{uri} permanent
}
-www.search.doan.luuduct.ai {
+https://www.{{SEARCH_HOST}}:{{HTTPS_PORT}} {
import https_security
- redir https://search.doan.luuduct.ai{uri} permanent
+ redir {{SEARCH_ORIGIN}}{uri} permanent
+}
+
+https://www.{{WKD_HOST}}:{{HTTPS_PORT}} {
+ import https_security
+ redir {{WKD_ORIGIN}}{uri} permanent
+}
+
+https://{{CHAT_HOST}}:{{HTTPS_PORT}} {
+ import https_security
+ reverse_proxy {{CHAT_UPSTREAM}}
}
-www.openpgpkey.luuduct.ai {
+https://www.{{CHAT_HOST}}:{{HTTPS_PORT}} {
import https_security
- redir https://openpgpkey.luuduct.ai{uri} permanent
+ redir {{CHAT_PUBLIC_ORIGIN}}{uri} permanent
}