Skip to content

Commit

Permalink
configure redirects for legacy urls
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Nov 3, 2024
1 parent caeb695 commit 307685c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
36 changes: 29 additions & 7 deletions fly/applications/caddy/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# {
# auto_https off
# }
{
log {
level DEBUG
}
}
:8080 {
# redirect Rogue Scholar legacy URLs
@blogs path /blogs /blogs/*
@posts path /posts /posts/*
@lang path /en /en/* /de /de/* /es /es/* /fr /fr/* /it /it/* /pt /pt/* /tr /tr/*
route {
@posts path /posts/*
@lang path /en/* /de/* /es/* /fr/* /it/* /pt/* /tr/*
@legacy path /about /board

redir @posts https://legacy.rogue-scholar.org{uri}
redir @lang https://legacy.rogue-scholar.org{uri}
redir @legacy https://legacy.rogue-scholar.org{uri}

redir @blogs https://legacy.rogue-scholar.org{uri}
redir @posts https://legacy.rogue-scholar.org{uri}
redir @lang https://legacy.rogue-scholar.org{uri}
uri replace /en /
uri replace /de /
uri replace /es /
uri replace /fr /
uri replace /it /
uri replace /pt /
uri replace /tr /
uri replace /posts /
uri replace /blogs /communities
uri replace /blogs/* /communities/*

redir / https://rogue-scholar.org{uri}
redir https://beta.rogue-scholar.org{uri}
# reverse_proxy 66.241.124.87
}
}
4 changes: 4 additions & 0 deletions fly/applications/caddy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM caddy:2.8.4

COPY ./Caddyfile /etc/caddy/Caddyfile

7 changes: 4 additions & 3 deletions fly/applications/caddy/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
app = 'rogue-scholar-caddy'
primary_region = 'fra'

[build]
image = 'caddy:2.8.4'

[http_service]
internal_port = 8080
force_https = true
Expand All @@ -21,3 +18,7 @@ primary_region = 'fra'
memory = '1gb'
cpu_kind = 'shared'
cpus = 1

[mounts]
source = "caddy_data"
destination = "/data"

0 comments on commit 307685c

Please sign in to comment.