New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx: How to enable dashboard on a sub-path? #683
Comments
It looks like when using
I guess I need a way to say "redirect path to path/" (maybe if the |
Hello @colemickens, you just have to define your Ingress rule like this :
Just remove the last / at path: /dashboard Then go to http://domain.tld/dashboard/, should works, i'm using that config too. |
But there's no automatic redirect. If you visit http://domain.tld/dashboard you get dropped on a blank white page. |
The same happens to me. It doesn't redirect from path: "/whatever" to "/" inside the service. There is any way to redirect from specified path in the ingress file to the root path of the service? |
This seems related to issue #646, there are some workarounds there. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
By borrowing idea from #646, following makes dashboard serve at cat <<EOF | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kubernetes-dashboard
namespace: kube-system
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/secure-backends: "true"
ingress.kubernetes.io/ssl-passthrough: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/"
# adds 301 redirect with trailing slash
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^(/kube)$ $1/kube/ permanent;
spec:
tls:
- hosts:
- dashboard.domain.tld
rules:
- host: dashboard.domain.tld
http:
paths:
- path: /kube
backend:
serviceName: kubernetes-dashboard
servicePort: 443
EOF |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I'm seeing this issue and the rewrite doesn't seem to work with a non-standard port. I'm using https://localhost:8002/dashboard to try and access the dashboard. The dashboard loads but fails to login, presumably related to how the dashboard does client-side routing. If I add a trailing slash, https://localhost:8002/dashboard/, I can login just fine. Here's my yaml
That configuration takes my Removing "permanent" on the rewrite goes back to login not working. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
This should probably be reopened, it's kind of hilarious/sad that it can't handle a missing trailing '/' and it isnt at all obvious what is going wrong. Isn't this a bug on the dashboard side and not the ingress side though? |
The same issue, anyone has an example ingress configuration for subpath consul? |
Recently I upgraded the image to latest and encountered a regression. In short, new version of image for any reason added a unnecessary As a result, it is no longer possible to enable the dashboard on sub-path. Please correct if I am wrong. image kubernetesui/dashboard:v2.0.0-rc6 - it does not work as the base href configuration preventing the dashboard works under any sub path.
image kubernetesui/dashboard:v2.0.0-rc5: it works fine
|
kubernetes/dashboard#5017 (comment) @grantsunny And that issue with hard base href should be already fixed in kubernetes/dashboard#5022 . |
Thanks @vutny! |
Evil issue got this evil fix on my box ... no permanent redirect.
Before down-voting this one consider upvoting @Queuecumber 's comment. |
This works, reliably:
On the other hand, this only works with
http://domain.tld/dashboard/
and nothttp://domain.tld/dashboard
(note trailing slash). And adding/removing a trailing slash to the 'path' field of the yaml has no effect:(Note, the delta is the host, the path, and the rewrite-target annotation)
From reading the HTML source of dashboard, I understand why this is happening, but I'm not familiar enough with nginx/ingress to know what the right fix is...
The text was updated successfully, but these errors were encountered: