Help with creating an ingress with redirect URL

Hi all,

Is there a way to create an ingress with the following example?:
if i hit www.example.com/objects/ and it will redirect to www.cloudstorage.com/bucketname/o/

I want to be able to basically curl -X PUT https://example.com/objects/filename and it will know it hits https://www.cloudstorage.com/bucketname/o/filename

Thanks all

It's hard for me to tell without trying. Did you try and it did not work? What was your config / errors, etc?

Hi zespri,

I tried the following yaml:

apiVersion: traefik.containo.us/v1alpha1

kind: Middleware
metadata:
  name: redirectobjectstorage
spec:
  redirectRegex:
    regex: https://ip_address/object
    replacement: https://objectstorage.xxxxxxx.oraclecloud.com/n/randomnum/b/bucketname/o/
    permanent: true

Can this work without an ingress and a service as i do not have a backend pod for this redirect? I just want a redirect a url with a made up /object
I know traefik reads from router and then checks if there is any middleware then uses services. Is there a way to redirect url only?

also since it is a https, in my other ingress use cases, i do have a tls:

  • secretName: secretname
    Do i use any tls here?