I have two applications/containers where I want them to be exposed in the same domain (with SSL) but at different routes and I'm facing an issue on the second app as it recognizes the extra prefix route as an application internal and returns a typical 404 error.
My setup:
App A
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: app
namespace: app-ns
spec:
entryPoints:
- websecure
routes:
- match: Host(`app.example.com`) && PathPrefix(`/`)
kind: Rule
services:
- name: app
port: 80
tls:
secretName: app-example-com-tls
App B
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: rstudio
namespace: app-ns
spec:
entryPoints:
- websecure
routes:
- match: Host(`app.example.com`) && PathPrefix(`/user`)
kind: Rule
services:
- name: rstudio
port: 8787
middlewares:
- name: rstudio
tls:
secretName: app-example-com-tls
App B Middleware
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: rstudio
namespace: app-ns
spec:
addPrefix:
prefix: /user
When navigating to "app.example.com/user" I get the below page coming from the App B (rocker/rstudio image):