I am currently using Caddy as a reverse proxy.
rewrite / /index.html
https://localhost/ --> https://localhost/index.html
https://localhost/?p1=v1&p2=v2 --> https://localhost/index.html?p1=v1&p2=v2
Now I want to additionally change the path /static to index.html. However, a URL parameter static=true should then be added.
https://localhost/static --> https://localhost/index.html?static=true
This additional URL parameter should not influence the existing parameters.
https://localhost/static?p1=v1&p2=v2 --> https://localhost/index.html?static=true&p1=v1&p2=v2
How do I have to adjust my caddyfile to make this work as desired? I just tried the following, but unfortunately it didn't work.
rewrite /static /index.html?static=true
{query} is the old query params,so can do like this:
rewrite /static index.html?{query}&static=true
the documents: placeholders
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With