From 4ce1a59d14196ab3e1d7706ebd16776bf1f707f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=B9=BF?= Date: Mon, 18 Dec 2023 14:11:06 +0800 Subject: [PATCH] fix and add add config for cloudops --- config.json | 33 ++++++++++++++++++++++----------- model/model.go | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/config.json b/config.json index 2b896a6..31db6ce 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "logging" :{ + "logging" :{ "appenders": { "out" :{ "type": "file", @@ -37,21 +37,32 @@ ] }, "servers":[{ - "port" : 8080, - "name":"demo", + "port": 8000, + "name": "cloudops", "paths":[ { "path": "/", - "root": "./public/", - "default": "index.html" + "upstreams": ["http://192.168.12.174:9880"], + "directives":["HostSchemas $target"] }, { - "path": "/ws", - "upstreams":["http://localhost:3000"], - "pathrewrite": { - "replace": "/ws", - "with": "/" - } + "path" : "/ssologin", + "upstreams": ["http://192.168.12.174:9880"], + "directives":["HostSchemas $target"] + }, + { + "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" + ] } ] }] diff --git a/model/model.go b/model/model.go index 9c76e59..fd2940d 100644 --- a/model/model.go +++ b/model/model.go @@ -13,7 +13,7 @@ type HttpPath struct { Root string `json:"root"` Default string `json:"default"` Upstreams []string `json:"upstreams"` - Directives string `json:"directives"` + Directives []string `json:"directives"` } type HeaderValueConst string