|
|
|
@ -38,13 +38,14 @@ type pathConfig struct {
|
|
|
|
|
Type string
|
|
|
|
|
|
|
|
|
|
// Cache duration
|
|
|
|
|
Cache int64 `default:"-1965"`
|
|
|
|
|
Cache string
|
|
|
|
|
|
|
|
|
|
// FastCGI server address
|
|
|
|
|
FastCGI string
|
|
|
|
|
|
|
|
|
|
r *regexp.Regexp
|
|
|
|
|
cmd []string
|
|
|
|
|
r *regexp.Regexp
|
|
|
|
|
cmd []string
|
|
|
|
|
cache int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type hostConfig struct {
|
|
|
|
@ -69,6 +70,8 @@ type serverConfig struct {
|
|
|
|
|
fcgiPools map[string]gofast.ConnFactory
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cacheUnset = -1965
|
|
|
|
|
|
|
|
|
|
var config *serverConfig
|
|
|
|
|
|
|
|
|
|
func readconfig(configPath string) error {
|
|
|
|
@ -139,6 +142,14 @@ func readconfig(configPath string) error {
|
|
|
|
|
serve.r = regexp.MustCompile(serve.Path)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
serve.cache = cacheUnset
|
|
|
|
|
if serve.Cache != "" {
|
|
|
|
|
serve.cache, err = strconv.ParseInt(serve.Cache, 10, 64)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatalf("failed to parse cache duration for path %s: %s", serve.Path, err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if serve.FastCGI != "" {
|
|
|
|
|
if serve.Root == "" {
|
|
|
|
|
log.Fatalf("root must be specified to use fastcgi resource %s of path %s%s", serve.FastCGI, hostname, serve.Path)
|
|
|
|
|