diff --git a/Caddyfile b/Caddyfile index f2070ad..172f95a 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,13 +1,4 @@ localhost :443 { - # redirect 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/* - - redir @blogs https://legacy.rogue-scholar.org{uri} - redir @posts https://legacy.rogue-scholar.org{uri} - redir @lang https://legacy.rogue-scholar.org{uri} - root /static/* /opt/invenio/var/instance/static try_files {path} {path}/ /index.html reverse_proxy web:5000 diff --git a/etc/caddy/Caddyfile b/fly/applications/caddy/Caddyfile similarity index 72% rename from etc/caddy/Caddyfile rename to fly/applications/caddy/Caddyfile index 44ae79b..17e557b 100644 --- a/etc/caddy/Caddyfile +++ b/fly/applications/caddy/Caddyfile @@ -1,5 +1,5 @@ -0.0.0.0:6000 { - # redirect legacy URLs +: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/* @@ -8,6 +8,5 @@ redir @posts https://legacy.rogue-scholar.org{uri} redir @lang https://legacy.rogue-scholar.org{uri} - # requests get proxied to the backend server - reverse_proxy 0.0.0.0:5000 + redir / https://rogue-scholar.org{uri} } diff --git a/fly/applications/caddy/fly.toml b/fly/applications/caddy/fly.toml new file mode 100644 index 0000000..05fff04 --- /dev/null +++ b/fly/applications/caddy/fly.toml @@ -0,0 +1,23 @@ +# fly.toml app configuration file generated for rogue-scholar-caddy on 2024-11-03T11:26:41+01:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'rogue-scholar-caddy' +primary_region = 'ams' + +[build] + image = 'caddy:2.8.4' + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1