Skip to content

Commit

Permalink
reorganize Caddyfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Nov 3, 2024
1 parent 2fdc5f2 commit dfc533a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
9 changes: 0 additions & 9 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions etc/caddy/Caddyfile → fly/applications/caddy/Caddyfile
Original file line number Diff line number Diff line change
@@ -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/*
Expand All @@ -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}
}
23 changes: 23 additions & 0 deletions fly/applications/caddy/fly.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dfc533a

Please sign in to comment.