fix and add add config for cloudops

This commit is contained in:
程广 2023-12-18 14:11:06 +08:00
parent d180d65524
commit 4ce1a59d14
2 changed files with 23 additions and 12 deletions

View File

@ -37,21 +37,32 @@
] ]
}, },
"servers":[{ "servers":[{
"port" : 8080, "port": 8000,
"name":"demo", "name": "cloudops",
"paths":[ "paths":[
{ {
"path": "/", "path": "/",
"root": "./public/", "upstreams": ["http://192.168.12.174:9880"],
"default": "index.html" "directives":["HostSchemas $target"]
}, },
{ {
"path": "/ws", "path" : "/ssologin",
"upstreams":["http://localhost:3000"], "upstreams": ["http://192.168.12.174:9880"],
"pathrewrite": { "directives":["HostSchemas $target"]
"replace": "/ws", },
"with": "/" {
} "path" : "/themes",
"upstreams": ["http://192.168.12.174:9880"],
"directives":["HostSchemas $target"]
},
{
"path" : "/thing",
"upstreams": ["http://192.168.12.174:9880"],
"directives":[
"HostSchemas $target",
"HeaderOrigin",
"RemoveCookie token"
]
} }
] ]
}] }]

View File

@ -13,7 +13,7 @@ type HttpPath struct {
Root string `json:"root"` Root string `json:"root"`
Default string `json:"default"` Default string `json:"default"`
Upstreams []string `json:"upstreams"` Upstreams []string `json:"upstreams"`
Directives string `json:"directives"` Directives []string `json:"directives"`
} }
type HeaderValueConst string type HeaderValueConst string