Skip to content

Commit

Permalink
feat(docs): Document service discovery with nginx and ingress
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <[email protected]>
  • Loading branch information
provokateurin committed Dec 2, 2023
1 parent 8cb6585 commit 837e1d8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 4.5.4
version: 4.5.5
appVersion: 27.1.4
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
33 changes: 33 additions & 0 deletions charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,39 @@ nginx
enabled: true
```
### Service discovery with nginx and ingress
For service discovery (CalDAV, CardDAV, webfinger, nodeinfo) to work you need to add redirects to your ingress.
If you use the [ingress-nginx](https://github.com/kubernetes/ingress-nginx) you can use the following server snippet annotation:
```yaml
ingress:
annotations:
nginx.ingress.kubernetes.io/server-snippet: |-
server_tokens off;
proxy_hide_header X-Powered-By;
rewrite ^/.well-known/webfinger /index.php/.well-known/webfinger last;
rewrite ^/.well-known/nodeinfo /index.php/.well-known/nodeinfo last;
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:autotest|occ|issue|indie|db_|console) {
deny all;
}
```
## Preserving Source IP
- Make sure your loadbalancer preserves source IP, for bare metal, `metalb` does and `klipper-lb` doesn't.
Expand Down
1 change: 1 addition & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ingress:
# nginx.ingress.kubernetes.io/proxy-body-size: 4G
# kubernetes.io/tls-acme: "true"
# cert-manager.io/cluster-issuer: letsencrypt-prod
# # Keep this in sync with the README.md:
# nginx.ingress.kubernetes.io/server-snippet: |-
# server_tokens off;
# proxy_hide_header X-Powered-By;
Expand Down

0 comments on commit 837e1d8

Please sign in to comment.