I have a project where Varnish is used in front of a Slim 4 project. Due to some project specialities, the original url should be hidden and the incoming request is rewritten to some other headers.
- Original call to demo.xyz is coming to Varnish
- Varnish is transforming the request to
- The original host is saved in the header with
The Slim App needs to detect if it is a Varnish request (I already got that) and needs to transform the routes.
So when creating a route with
url_for (Twig-View package) the urls should be generated like that:
- Route w/o Varnish:
- Route w/ Varnish:
- Modify the original UriInterface object but I have no idea how.
- Write a TwigExtension for Twig-View to modify the methods for
url_forand so on.
Any idea what to do?
Thanks in advance!