Skip to content
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

'/login' endpoint 404 #160

Open
ixcat opened this issue Oct 4, 2021 · 4 comments
Open

'/login' endpoint 404 #160

ixcat opened this issue Oct 4, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@ixcat
Copy link

ixcat commented Oct 4, 2021

Running labbook for internal user demo project (k8s/ingress-nginx) and MAP (traefik in docker mode) yields a 404 for the '/login' route which is returned after logout; routes appear correct w/r/t 'reference' docker-compose-deploy.yaml; was not able to regression test with this configuration due to certificate issue. Can adjust routes on deployments, but would be good to confirm this is expected and/or ensure proper functionality in 'reference' configuration

can provide runtime configuration / live URL's out of band for review (project related / should be private)

tag @kabilar to keep in the loop w/r/t user demo project

@ixcat ixcat added the bug Something isn't working label Oct 4, 2021
@guzman-raphael
Copy link
Collaborator

guzman-raphael commented Oct 4, 2021

@ixcat Thanks for the report. For the k8s/ingress-nginx one, appears as if the rewrites on the frontend routes are not working properly. We likely need to include the rewrite logic there as well in the config.

See pharus vs labbook.

@ixcat
Copy link
Author

ixcat commented Oct 4, 2021

thanks @guzman-raphael -

applied with:

$ git diff labbook/ingress.yaml 
diff --git a/k8s/ev-env/labbook/labbook/ingress.yaml b/k8s/ev-env/labbook/labbook/ingress.yaml
index 37df599..09f9f6f 100644
--- a/k8s/ev-env/labbook/labbook/ingress.yaml
+++ b/k8s/ev-env/labbook/labbook/ingress.yaml
@@ -4,7 +4,7 @@ kind: Ingress
 metadata:
   name: labbook-ui
   annotations:
-    nginx.ingress.kubernetes.io/rewrite-target: /
+    nginx.ingress.kubernetes.io/rewrite-target: /$1
     nginx.ingress.kubernetes.io/ssl-redirect: "true"
     # cert-manager.io/cluster-issuer: letsencrypt-staging
     cert-manager.io/cluster-issuer: letsencrypt-prod
@@ -13,7 +13,7 @@ spec:
   - host: ev3b-labbook.datajoint.io
     http:
       paths:
-      - path: /
+      - path: /(.*)
         backend:
           serviceName: labbook-ui
           servicePort: http

to same effect

i'm fairly certain i encountered this on the local setup in the past but http container cert is out of date so don't have a way to easily check.

can we confirm local is OK 1st?

@guzman-raphael
Copy link
Collaborator

@ixcat I see. Let me check what deploy manifests I may have and verify the issue/solution. There might be 'layered' nginx's here and I may be getting confused on the context.

@ixcat
Copy link
Author

ixcat commented Oct 16, 2021

update: was running on base nginx image - adjusting base nginx default.conf as proposed elsewhere resolves the error:

sed -e 's|location /|location ~ /(.*)|g' \
	-e 's|index  index.html index.htm;|index  index.html index.htm;\n\ttry_files $uri /index.html;|g' \
	/etc/nginx/conf.d/default.conf > /etc/nginx/conf.d/default.conf.tmp-$$ \
	&& mv /etc/nginx/conf.d/default.conf.tmp-$$ /etc/nginx/conf.d/default.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants