Substitution plugin idea

Before starting the work I wanted to get some more feedback on syntax etc.
As I already suggested a substitution plugin similar to nginx sub module would come in handy.

It would enable basic string substitution.

substitute [basepath] {
    ext "extensions"
    string "string to search for"
    sub "replacement string"
}
substitute [basepath] {
    ext .js .css .png .mp4
    string "www.example.com"
    sub "cdn.example.com"
}

Any thoughts?

2 Likes

Just FYI, see https://github.com/mholt/caddy/pull/76 for a similar proposal a long time ago.

2 Likes

definitely would like to see this !