diff --git a/internal/web/actions/default/servers/server/settings/reverseProxy/setting.go b/internal/web/actions/default/servers/server/settings/reverseProxy/setting.go index c5d9610d..112f93cf 100644 --- a/internal/web/actions/default/servers/server/settings/reverseProxy/setting.go +++ b/internal/web/actions/default/servers/server/settings/reverseProxy/setting.go @@ -55,9 +55,7 @@ func (this *SettingAction) RunPost(params struct { }) { defer this.CreateLogInfo("修改代理服务 %d 的反向代理设置", params.ServerId) - // TODO 校验配置 - - reverseProxyConfig := &serverconfigs.ReverseProxyConfig{} + var reverseProxyConfig = &serverconfigs.ReverseProxyConfig{} err := json.Unmarshal(params.ReverseProxyJSON, reverseProxyConfig) if err != nil { this.ErrorPage(err) @@ -118,20 +116,21 @@ func (this *SettingAction) RunPost(params struct { // 设置反向代理相关信息 _, err = this.RPC().ReverseProxyRPC().UpdateReverseProxy(this.AdminContext(), &pb.UpdateReverseProxyRequest{ - ReverseProxyId: reverseProxyConfig.Id, - RequestHostType: types.Int32(reverseProxyConfig.RequestHostType), - RequestHost: reverseProxyConfig.RequestHost, - RequestURI: reverseProxyConfig.RequestURI, - StripPrefix: reverseProxyConfig.StripPrefix, - AutoFlush: reverseProxyConfig.AutoFlush, - AddHeaders: reverseProxyConfig.AddHeaders, - ConnTimeoutJSON: connTimeoutJSON, - ReadTimeoutJSON: readTimeoutJSON, - IdleTimeoutJSON: idleTimeoutJSON, - MaxConns: types.Int32(reverseProxyConfig.MaxConns), - MaxIdleConns: types.Int32(reverseProxyConfig.MaxIdleConns), - ProxyProtocolJSON: proxyProtocolJSON, - FollowRedirects: reverseProxyConfig.FollowRedirects, + ReverseProxyId: reverseProxyConfig.Id, + RequestHostType: types.Int32(reverseProxyConfig.RequestHostType), + RequestHost: reverseProxyConfig.RequestHost, + RequestURI: reverseProxyConfig.RequestURI, + StripPrefix: reverseProxyConfig.StripPrefix, + AutoFlush: reverseProxyConfig.AutoFlush, + AddHeaders: reverseProxyConfig.AddHeaders, + ConnTimeoutJSON: connTimeoutJSON, + ReadTimeoutJSON: readTimeoutJSON, + IdleTimeoutJSON: idleTimeoutJSON, + MaxConns: types.Int32(reverseProxyConfig.MaxConns), + MaxIdleConns: types.Int32(reverseProxyConfig.MaxIdleConns), + ProxyProtocolJSON: proxyProtocolJSON, + FollowRedirects: reverseProxyConfig.FollowRedirects, + RequestHostExcludingPort: reverseProxyConfig.RequestHostExcludingPort, }) if err != nil { this.ErrorPage(err) diff --git a/web/public/js/components/server/reverse-proxy-box.js b/web/public/js/components/server/reverse-proxy-box.js index 33a967b0..382ba267 100644 --- a/web/public/js/components/server/reverse-proxy-box.js +++ b/web/public/js/components/server/reverse-proxy-box.js @@ -18,6 +18,7 @@ Vue.component("reverse-proxy-box", { requestURI: "", requestHost: "", requestHostType: 0, + requestHostExcludingPort: false, addHeaders: [], connTimeout: {count: 0, unit: "second"}, readTimeout: {count: 0, unit: "second"}, @@ -169,18 +170,24 @@ Vue.component("reverse-proxy-box", {
请求源站时的Host,用于修改源站接收到的域名 - ,"跟随代理服务"是指源站接收到的域名和当前代理服务保持一致 + ,"跟随CDN域名"是指源站接收到的域名和当前CDN访问域名保持一致 ,"跟随源站"是指源站接收到的域名仍然是填写的源站地址中的信息,不随代理服务域名改变而改变 ,自定义Host内容中支持请求变量。
选中后表示移除回源主机名中的端口部分。
+