Repository: caddyserver/caddy (language: go)

Issue:
Request: add placeholder substitution for file_server fields
Problem: trying to use place holders in the `file_server`'s fields, e.g.:

```
    file_server {
      index "index.{host}.html"
    }
```

Does not substitute `{host}` with the host domain.

Request:add placeholder substitution for all `file_server` fields.

Thanks!



Discussion / hints:
@francislavoie @brucejo75 
Hi, I’d like to work on this issue.

We can replace {host} in indexPage into req.URL.Host(without port) or req.Host before following the sanitizing. 
https://github.com/caddyserver/caddy/blob/22d8edb984b9a0cbe5d205f823b455920464bb95/modules/caddyhttp/fileserver/staticfiles.go#L203
@u5surf Basically we just need to run `repl` on the `indexPage` value.

Fix patch:
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go
index 011460785e3..9a2bc6e288a 100644
--- a/modules/caddyhttp/fileserver/staticfiles.go
+++ b/modules/caddyhttp/fileserver/staticfiles.go
@@ -200,6 +200,7 @@ func (fsrv *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request, next c
 	var implicitIndexFile bool
 	if info.IsDir() && len(fsrv.IndexNames) > 0 {
 		for _, indexPage := range fsrv.IndexNames {
+			indexPage := repl.ReplaceAll(indexPage, "")
 			indexPath := caddyhttp.SanitizedPathJoin(filename, indexPage)
 			if fileHidden(indexPath, filesToHide) {
 				// pretend this file doesn't exist


Test patch:
diff --git a/caddytest/integration/caddyfile_test.go b/caddytest/integration/caddyfile_test.go
index 4e9bdd9811c..be85f4ab841 100644
--- a/caddytest/integration/caddyfile_test.go
+++ b/caddytest/integration/caddyfile_test.go
@@ -101,3 +101,27 @@ func TestReadCookie(t *testing.T) {
 	// act and assert
 	tester.AssertGetResponse("http://localhost:9080/cookie.html", 200, "<h2>Cookie.ClientName caddytest</h2>")
 }
+
+func TestReplIndex(t *testing.T) {
+
+	tester := caddytest.NewTester(t)
+	tester.InitServer(`
+  {
+    http_port     9080
+    https_port    9443
+  }
+
+  localhost:9080 {
+    templates {
+      root testdata
+    }
+    file_server {
+      root testdata
+      index "index.{host}.html"
+    }
+  }
+  `, "caddyfile")
+
+	// act and assert
+	tester.AssertGetResponse("http://localhost:9080/", 200, "")
+}
diff --git a/caddytest/integration/testdata/index.localhost.html b/caddytest/integration/testdata/index.localhost.html
new file mode 100644
index 00000000000..e69de29bb2d