找回密码
 立即注册

QQ登录

只需一步,快速开始

豪~豪 悬赏达人认证 活字格认证

银牌会员

86

主题

1213

帖子

3175

积分

银牌会员

积分
3175

时代开发者征文活动活字格高级认证悬赏达人圣诞拼拼乐活字格认证

QQ

[已处理] 反向代理出错

豪~豪 悬赏达人认证 活字格认证
银牌会员   /  发表于:2023-2-23 11:17  /   查看:2351  /  回复:14
  1. {
  2.   "ClassName": "System.ArgumentOutOfRangeException",
  3.   "Message": "startIndex cannot be larger than length of string.",
  4.   "Data": null,
  5.   "InnerException": null,
  6.   "HelpURL": null,
  7.   "StackTraceString": "   at System.String.Substring(Int32 startIndex, Int32 length)
  8.    at Forguncy.Server2.Controllers.HomeController.GetActualPageName(HttpContext context, String pageName, Boolean isMobile)
  9.    at Forguncy.Server2.Controllers.HomeController.c(String A_0, Boolean A_1)
  10.    at Forguncy.Server2.Controllers.HomeController.GetMetadata(String pageName, String token, Boolean isMobile)
  11.    at lambda_method301(Closure , Object )
  12.    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
  13.    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
  14.    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
  15.    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
  16.    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
  17.    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
  18. --- End of stack trace from previous location ---
  19.    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
  20.    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
  21.    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
  22.    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
  23.    at Forguncy.Server2.KatanaMiddleware.ProcessEngineMiddleware.InvokeAsync(HttpContext context, ICacheService cacheService)
  24.    at Forguncy.Server2.KatanaMiddleware.ReportsMiddleware.InvokeAsync(HttpContext context, ICacheService cacheService, IReportServerService reportServerService)
  25.    at Forguncy.KatanaMiddleware.ServerCommandMiddleware.InvokeAsync(HttpContext context)
  26.    at Forguncy.KatanaMiddleware.k.InvokeAsync(HttpContext context)
  27.    at Forguncy.KatanaMiddleware.j.InvokeAsync(HttpContext context)
  28.    at Forguncy.Server2.KatanaMiddleware.StartPageMiddleware.InvokeAsync(HttpContext context)
  29.    at ForguncyServerCommon.HttpHeaderMiddlewareBase.InvokeAsync(HttpContext context)
  30.    at Forguncy.KatanaMiddleware.q.InvokeAsync(HttpContext context)",
  31.   "RemoteStackTraceString": null,
  32.   "RemoteStackIndex": 0,
  33.   "ExceptionMethod": null,
  34.   "HResult": -2146233086,
  35.   "Source": "System.Private.CoreLib",
  36.   "WatsonBuckets": null,
  37.   "ParamName": "startIndex",
  38.   "ActualValue": null
  39. }
复制代码



请求 URL:http://xxxxx.xxxxxxx.com/ym/Home/GetMetadata
请求方法:
POST

请求数据:pageName=PathName%3A%2F&token=&isMobile=false

14 个回复

倒序浏览
豪~豪悬赏达人认证 活字格认证
银牌会员   /  发表于:2023-2-23 11:22:11
沙发
不能省略应用路径吗
回复 使用道具 举报
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
论坛元老   /  发表于:2023-2-23 12:02:04
板凳
能否说一下反向代理的做法,已经提供完整的日志吗?
一看就会,超有用活字格技能:四十五,错误日志收集功能
https://gcdn.grapecity.com.cn/fo ... 4&fromuid=63496
(出处: 葡萄城产品技术社区)
回复 使用道具 举报
豪~豪悬赏达人认证 活字格认证
银牌会员   /  发表于:2023-2-23 13:03:36
地板
David.Zhong 发表于 2023-2-23 12:02
能否说一下反向代理的做法,已经提供完整的日志吗?
一看就会,超有用活字格技能:四十五,错误日志收集功 ...

通过分析是因为MetadataLoader.js这个文件使用的decodeURIComponent(location.pathname);方法获取当前页面的路径地址,但是我反向代理,我想直接代理这个应用地址,导致decodeURIComponent(location.pathname);方法获取到是/相当于没有获取到应用名称,然后导致发送GetMetadata的POST方法的应用名称是错的,导致报错了
回复 使用道具 举报
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
论坛元老   /  发表于:2023-2-23 13:55:15
5#

大佬是只代理某个应用不是代理整个服务器?

帮你打开活字格更神奇的功能:八十,当活字格遇上反向代理——开篇介绍
https://gcdn.grapecity.com.cn/fo ... 7&fromuid=63496
(出处: 葡萄城产品技术社区)

帮你打开活字格更神奇的功能:八十一,当活字格遇上反向代理——实现三种场景的反代
https://gcdn.grapecity.com.cn/fo ... 1&fromuid=63496
(出处: 葡萄城产品技术社区)


回复 使用道具 举报
豪~豪悬赏达人认证 活字格认证
银牌会员   /  发表于:2023-2-23 14:45:00
6#
David.Zhong 发表于 2023-2-23 13:55
大佬是只代理某个应用不是代理整个服务器?

帮你打开活字格更神奇的功能:八十,当活字格遇上反向代理 ...

我是想代理某个,比如    baidu.xxxx.com     进去就是baidu的应用名称 而不需要baidu.xxxx.com/baidu这样去访问
回复 使用道具 举报
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
论坛元老   /  发表于:2023-2-23 16:01:19
7#
能看下大佬代理是怎么设置的吗?或者大佬理一下层层代理的思路?怎么想都不对劲,不应该不work的。比如说反向代理  把www.domain.com 映射到 127.0.0.1/appname 上,客户端访问www.domain.com,那么所有的请求都会映射到127.0.0.1/appname 上。大佬说的路径地址是?
回复 使用道具 举报
豪~豪悬赏达人认证 活字格认证
银牌会员   /  发表于:2023-2-23 16:27:32
8#
David.Zhong 发表于 2023-2-23 16:01
能看下大佬代理是怎么设置的吗?或者大佬理一下层层代理的思路?怎么想都不对劲,不应该不work的。比如说反 ...

就那个请求出错,其他是好的

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
论坛元老   /  发表于:2023-2-23 17:05:16
9#
应用的端口号是22345?
回复 使用道具 举报
豪~豪悬赏达人认证 活字格认证
银牌会员   /  发表于:2023-2-23 17:15:11
10#
David.Zhong 发表于 2023-2-23 17:05
应用的端口号是22345?

这个应该是个通用型bug,没设置默认应用的话就会出错
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部