My nginx ingress dont redirect correctly urls having the special characters "[" and "]" to the backend service. There is my ingress config:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ $app }}-ingress
labels:
app: {{ $app }}
chart: chart-{{ $app }}
app.kubernetes.io/managed-by: Helm
annotations:
meta.helm.sh/release-name: {{ $app }}
meta.helm.sh/release-namespace: {{ .Release.Namespace }}
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: "{{ $proxy_body_size }}"
nginx.ingress.kubernetes.io/proxy-read-timeout: "{{ $proxy_read_timeout }}"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "{{ $proxy_connect_timeout }}"
nginx.ingress.kubernetes.io/proxy-send-timeout: "{{ $proxy_send_timeout }}"
nginx.ingress.kubernetes.io/proxy-buffer-size: "{{ $proxy_buffer_size }}"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
tls:
- hosts:
- {{ $alias }}
rules:
- host: {{ $alias }}
http:
paths:
- path: /(.*)
backend:
serviceName: {{ $app }}-service
servicePort: http-back
All Urls are redirected to back successfully, except some urls witch have "[" and "]" characters. Example: https://example.com/api/v1/bookingLine/2020Z16011-00003/broadcastWave/2020Z16011-00003_20200228_20200228/content/Capture%20d%E2%80%99%C3%A9cran%202021-02-16%20103718%5B%5D.png These characters are well encoded but the received response is 400 Bad request When I remove [] from the name of png it redirect successfully.
Have you idea to add support of these special characters in rewrite?
Thanks