This example is specifically about Nextcloud, although I had the same (unsolved issue) in the past with others.
What I simply want to do, is to access nextcloud under www.myserver.com/nextcloud
.
I am able to kind of accessing Nextcloud front page with my present setup, but everything that's not directly under the basepath, is broken. Images and JS for instance.
Sure enough, I can manually enter in my browser web address something like www.myserver.com/nextcloud/core/css/guest.css
, and it's there. But the issue is that the front page from Nextcloud, tries to access everything under: www.myserver.com/core/css/guest.css
Here is my ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nextcloud
namespace: homeserver
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-staging
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: www.myserver.com
http:
paths:
- path: /nextcloud(/|$)(.*)
pathType: Prefix
backend:
service:
name: nextcloud
port:
number: 80