feat(infra/k8s): Rewrite cgit URLs by routing them through nginx
Configures nginx to rewrite all requests to cgit, except for those retrieving static files, to `/depot/`. In combination with the previous commits that apply patches to cgit itself, this effectively means that the depot is rendered on the site root. This is pretty cool: It lets people do stuff like `git clone https://git.tazj.in` and get the depot!
This commit is contained in:
parent
0dee62cd7b
commit
c3586aa8ba
3 changed files with 27 additions and 10 deletions
|
|
@ -8,20 +8,23 @@ metadata:
|
|||
annotations:
|
||||
networking.gke.io/managed-certificates: tazj-in, git-tazj-in, www-tazj-in, oslo-pub
|
||||
spec:
|
||||
# Default traffic is routed to the blog, in case people go to
|
||||
# peculiar hostnames.
|
||||
backend:
|
||||
serviceName: tazblog
|
||||
servicePort: 8000
|
||||
rules:
|
||||
# Route blog to the blog ...
|
||||
- host: tazj.in
|
||||
http:
|
||||
paths:
|
||||
- path: /*
|
||||
backend:
|
||||
serviceName: tazblog
|
||||
servicePort: 8000
|
||||
# Route git.tazj.in to the cgit pods
|
||||
- host: git.tazj.in
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
- path: /*
|
||||
backend:
|
||||
serviceName: cgit
|
||||
servicePort: 2448
|
||||
serviceName: nginx
|
||||
servicePort: 6756
|
||||
# Route oslo.pub to the nginx instance which serves redirects
|
||||
- host: oslo.pub
|
||||
http:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue