I have service in Kubernetes on port 8804 (Java application in container), it response on URL ends with /dashboards I'm publish this service with Contour HTTPProxy:
---
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: demo-dashboards-route
namespace: demo-dashboards
spec:
virtualhost:
fqdn: demos.cuba-labs.com
routes:
- services:
- name: demo-dashboards-app
port: 8804
loadBalancerPolicy:
strategy: CookieMy application work well with URL http://demos.cuba-labs.com/dashboards:
The next step I want to do is automatically redirect from the URL http://demos.cuba-labs.com to http://demos.cuba-labs.com/dashboards I do this:
---
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: demo-dashboards-route
namespace: demo-dashboards
spec:
virtualhost:
fqdn: demos.cuba-labs.com
routes:
- services:
- name: demo-dashboards-app
port: 8804
loadBalancerPolicy:
strategy: Cookie
pathRewritePolicy:
replacePrefix:
- prefix: /
replacement: /dashboardsI go to root URL - http://demos.cuba-labs.com I see the following situation:
URL is being doubled: /dashboardsdashboards
What am I doing wrong?