反向代理出错
{"ClassName": "System.ArgumentOutOfRangeException",
"Message": "startIndex cannot be larger than length of string.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at System.String.Substring(Int32 startIndex, Int32 length)
at Forguncy.Server2.Controllers.HomeController.GetActualPageName(HttpContext context, String pageName, Boolean isMobile)
at Forguncy.Server2.Controllers.HomeController.c(String A_0, Boolean A_1)
at Forguncy.Server2.Controllers.HomeController.GetMetadata(String pageName, String token, Boolean isMobile)
at lambda_method301(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Forguncy.Server2.KatanaMiddleware.ProcessEngineMiddleware.InvokeAsync(HttpContext context, ICacheService cacheService)
at Forguncy.Server2.KatanaMiddleware.ReportsMiddleware.InvokeAsync(HttpContext context, ICacheService cacheService, IReportServerService reportServerService)
at Forguncy.KatanaMiddleware.ServerCommandMiddleware.InvokeAsync(HttpContext context)
at Forguncy.KatanaMiddleware.k.InvokeAsync(HttpContext context)
at Forguncy.KatanaMiddleware.j.InvokeAsync(HttpContext context)
at Forguncy.Server2.KatanaMiddleware.StartPageMiddleware.InvokeAsync(HttpContext context)
at ForguncyServerCommon.HttpHeaderMiddlewareBase.InvokeAsync(HttpContext context)
at Forguncy.KatanaMiddleware.q.InvokeAsync(HttpContext context)",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2146233086,
"Source": "System.Private.CoreLib",
"WatsonBuckets": null,
"ParamName": "startIndex",
"ActualValue": null
}
请求 URL:http://xxxxx.xxxxxxx.com/ym/Home/GetMetadata
请求方法:
POST
请求数据:pageName=PathName%3A%2F&token=&isMobile=false
不能省略应用路径吗 能否说一下反向代理的做法,已经提供完整的日志吗?
一看就会,超有用活字格技能:四十五,错误日志收集功能
https://gcdn.grapecity.com.cn/forum.php?mod=viewthread&tid=52854&fromuid=63496
(出处: 葡萄城产品技术社区) David.Zhong 发表于 2023-2-23 12:02
能否说一下反向代理的做法,已经提供完整的日志吗?
一看就会,超有用活字格技能:四十五,错误日志收集功 ...
通过分析是因为MetadataLoader.js这个文件使用的decodeURIComponent(location.pathname);方法获取当前页面的路径地址,但是我反向代理,我想直接代理这个应用地址,导致decodeURIComponent(location.pathname);方法获取到是/相当于没有获取到应用名称,然后导致发送GetMetadata的POST方法的应用名称是错的,导致报错了
大佬是只代理某个应用不是代理整个服务器?
帮你打开活字格更神奇的功能:八十,当活字格遇上反向代理——开篇介绍
https://gcdn.grapecity.com.cn/forum.php?mod=viewthread&tid=74197&fromuid=63496
(出处: 葡萄城产品技术社区)
帮你打开活字格更神奇的功能:八十一,当活字格遇上反向代理——实现三种场景的反代
https://gcdn.grapecity.com.cn/forum.php?mod=viewthread&tid=74201&fromuid=63496
(出处: 葡萄城产品技术社区)
David.Zhong 发表于 2023-2-23 13:55
大佬是只代理某个应用不是代理整个服务器?
帮你打开活字格更神奇的功能:八十,当活字格遇上反向代理 ...
我是想代理某个,比如 baidu.xxxx.com 进去就是baidu的应用名称 而不需要baidu.xxxx.com/baidu这样去访问 能看下大佬代理是怎么设置的吗?或者大佬理一下层层代理的思路?怎么想都不对劲,不应该不work的。比如说反向代理把www.domain.com 映射到 127.0.0.1/appname 上,客户端访问www.domain.com,那么所有的请求都会映射到127.0.0.1/appname 上。大佬说的路径地址是? David.Zhong 发表于 2023-2-23 16:01
能看下大佬代理是怎么设置的吗?或者大佬理一下层层代理的思路?怎么想都不对劲,不应该不work的。比如说反 ...
就那个请求出错,其他是好的
应用的端口号是22345? David.Zhong 发表于 2023-2-23 17:05
应用的端口号是22345?
这个应该是个通用型bug,没设置默认应用的话就会出错
页:
[1]
2