I am using this ingress controller and would like to setup a s3 proxy to some bucket. If I call in a browser the url
https://my-kube-server.org/img/dog.jpg
I expect to see/download the image at
https://s3.eu-central-1.amazonaws.com/mybucket123/pictures/dog.jpg
I can setup a rewrite rule and point to an external service as explained in this example:
kind: Service
apiVersion: v1
metadata:
name: s3-proxy
spec:
type: ExternalName
externalName: s3.eu-central-1.amazonaws.com
headers:
- host: s3.eu-central-1.amazonaws.com
But I get errors from aws because it's required to have "Host:s3.eu-central-1.amazonaws.com" in the header. I cannot set this header neither in the s3-proxy service definition nor in the ingress rule (configuration-snippet doesn't work because it will add another Host header after it's set already in the nginx.conf pod.
My solution is to take the whole location block for this ingress rule and to include it as a server-snippet, which is pretty brute force.
Another option is to have an nginx pod+service behind ingress that takes care of setting the right headers. So the flow would be request -> ingress-controller -> nginx -> s3.
Has anybody an idea how to proxy s3?