ASP.NET在具有不同路径的反向代理后面形成身份验证
我有一个带有表单身份验证的ASP.NET web应用程序。它位于ASP.NET在具有不同路径的反向代理后面形成身份验证,asp.net,forms-authentication,reverse-proxy,Asp.net,Forms Authentication,Reverse Proxy,我有一个带有表单身份验证的ASP.NET web应用程序。它位于https://internal-IP/AppName/。表单身份验证的配置如下: <authentication mode="Forms"> <forms loginUrl="~/Login.aspx" defaultUrl="~/Home/News/" protection="All" timeout="120" name=".BLAH" requireSSL="true" slidingExpirat
https://internal-IP/AppName/
。表单身份验证的配置如下:
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" defaultUrl="~/Home/News/" protection="All" timeout="120" name=".BLAH" requireSSL="true" slidingExpiration="true" cookieless="UseCookies" enableCrossAppRedirects="true" />
</authentication>
它很好用
但是,我们有一个Apache反向代理,它允许外部用户访问vishttps://proxy-url/ProjectName/AppName/
。如您所见,路径中的文件夹级别比原始应用程序多一个
因此,~/Login.aspx
重定向到https://proxy-url/AppName/Login.aspx
而不是https://proxy-url/ProjectName/AppName/Login.aspx
这有什么办法吗?例如,为~
的值定义一些静态基本路径
谢谢你的帮助
克里斯。你是如何解决这个问题的?我也有类似的问题,我们没有。我们通过在web服务器上创建虚拟目录来解决这个问题,以反映代理强加的路径。