ProxyPreserveHost equivalent

Hi.
I'm trying to expose oracle apex with traefik 2.3 in a docker swarm.
After the login page, however, I get the following message:
The request could not be processed because this resource does not support Cross Origin Sharing requests or because the request source is not authorized to access this resource. If you use the reverse proxy function with ords, make sure the front-end server propagates the host name; for mod_proxy make sure 'ProxyPreserveHost' is set to 'On'.

I tried to add middleware to fix the CORS error, but without success:

   labels:
        - traefik.http.middlewares.oracle-cors.headers.accesscontrolallowmethods=GET,OPTIONS,PUT,HEAD,POST
        - traefik.http.middlewares.oracle-cors.headers.accessControlAllowOriginList=*
        - traefik.http.middlewares.oracle-cors.headers.accessControlExposeHeaders=*
        - traefik.http.middlewares.oracle-cors.headers.addvaryheader=true 
        - traefik.http.middlewares.oracle-cors.headers.hostsProxyHeaders=X-Forwarded-Hosts
        
        - traefik.enable=true
        - traefik.docker.network=traefik-public
        - traefik.http.routers.oracle.rule=Host("oracle.xxxxx.space")
        - traefik.http.routers.oracle.entrypoints=http
        - traefik.http.routers.oracle.middlewares=https-redirect
        - traefik.http.routers.oracle.service=oracle-dummy
        - traefik.http.services.oracle-dummy.loadbalancer.server.port=9999

        - traefik.http.routers.oracle-https.rule=Host("oracle.xxxxx.space")
        - traefik.http.routers.oracle-https.entrypoints=https
        - traefik.http.routers.oracle-https.tls=true
        - traefik.http.routers.oracle-https.middlewares=oracle-cors
        - traefik.http.routers.oracle-https.service=oracle-https
        - traefik.http.services.oracle-https.loadbalancer.server.port=8080
        - traefik.http.services.oracle-https.loadbalancer.passHostHeader=true

how can I "emulate" the "ProxyPreserveHost" option of mod_proxy?
Someone also recommend using "RequestHeader unset Origin". How can I do this in traefik?

thanks a lot to everyone!

1 Like

Necroing an old thread since I have the same problem. Anyone got a solution for what @FilippoBozzi asked? E.g. "emulate" the "ProxyPreserveHost" option of mod_proxy and/or "RequestHeader unset Origin" ?

Still looking for this