Skip to content

Commit

Permalink
add trailing slash for jupyterhub proxy paths (#2387)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-D-Lewis authored Apr 10, 2024
1 parent a5cbb13 commit e743bad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ resource "kubernetes_manifest" "jupyterhub" {
port = 80
}
]
middlewares = [
{
name = kubernetes_manifest.jupyterhub-proxy-add-slash.manifest.metadata.name
namespace = var.namespace
}
]
},
{
kind = "Rule"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,21 @@ resource "kubernetes_manifest" "jupyterhub-middleware-addprefix" {
}
}
}

resource "kubernetes_manifest" "jupyterhub-proxy-add-slash" {
manifest = {
apiVersion = "traefik.containo.us/v1alpha1"
kind = "Middleware"
metadata = {
name = "nebari-jupyterhub-proxy-add-slash"
namespace = var.namespace
}
spec = {
redirectRegex = {
regex = "^https://${var.external-url}/user/([^/]+)/proxy/(\\d+)$"
replacement = "https://${var.external-url}/user/$${1}/proxy/$${2}/"
permanent = true
}
}
}
}

0 comments on commit e743bad

Please sign in to comment.