Skip to content

Commit

Permalink
Serve staticfile direct from nginx unit
Browse files Browse the repository at this point in the history
We don't need to use django for staticfiles (even if there is a CDN
in front)
  • Loading branch information
frankh committed Apr 4, 2024
1 parent 93dd58f commit 3181e1e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion unit.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"listeners": {
"*:8000": {
"pass": "applications/posthog"
"pass": "routes/posthog"
},
"*:8001": {
"pass": "routes/metrics"
Expand All @@ -16,6 +16,22 @@
}
},
"routes": {
"posthog": [
{
"match": {
"uri": ["/static/*"]
},
"action": {
"rewrite": "`${uri.slice(7)}`",
"share": ["/code/staticfiles$uri", "/code/frontend/dist$uri", "/code/posthog/year_in_posthog/images$uri"]
}
},
{
"action": {
"pass": "applications/posthog"
}
}
],
"metrics": [
{
"match": {
Expand Down

0 comments on commit 3181e1e

Please sign in to comment.