-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
71 lines (56 loc) · 1.45 KB
/
Caddyfile
File metadata and controls
71 lines (56 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Caddyfile for ECEEE v4 Production - Three Site Architecture
# Caddy automatically handles HTTPS/TLS certificates via Let's Encrypt
{
# Global options
email {$EMAIL:noreply@eceee.fred.nu}
}
# Public Content Site - Django backend serving public pages
eceee.fred.nu {
encode gzip
# Block admin access on public site (redirect to admin subdomain)
handle /admin* {
redir https://admin.eceee.fred.nu{uri} permanent
}
# Serve static files
handle /static/* {
reverse_proxy backend:8000
}
# Serve media files
handle /media/* {
reverse_proxy backend:8000
}
# API endpoints
handle /api/* {
reverse_proxy backend:8000
}
# All other requests go to Django backend
handle /* {
reverse_proxy backend:8000
}
}
# Django Admin Site - Admin panel only
admin.eceee.fred.nu {
encode gzip
# All requests go to Django admin
reverse_proxy backend:8000
}
# React CMS Editor - Frontend application for content editing
app.eceee.fred.nu {
encode gzip
# API calls go to backend
handle /api/* {
reverse_proxy backend:8000
}
# Static files from backend
handle /static/* {
reverse_proxy backend:8000
}
# Media files from backend
handle /media/* {
reverse_proxy backend:8000
}
# Everything else goes to React app
handle /* {
reverse_proxy frontend:80
}
}