开发者

Caddy: Rewrite path to URL parameter

开发者 https://www.devze.com 2022-12-07 17:23 出处:网络
I am currently using Caddy as a reverse proxy. rewrite / /index.html https://localhost/ --> https://localhost/index.html

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 para开发者_运维百科meters.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消