SSRS 2016 报告无法从服务器外部访问虚拟文件夹(对于某些内部请求有一堆 400 "bad request" 错误)

SSRS 2016 Reports Virtual folder is not accessible from outside the server (with the bunch of 400 "bad request" errors for some internal requests)

我在从服务器外部访问 SSRS 2016 "Reports" 虚拟文件夹时遇到问题。

服务器位于 AWS 云服务器中,为了使用 RDP 访问它,我们(在 BI 部门)使用服务器名称 "xxx-test-xxx.eu-central-1.elb.amazonaws.com"。 我不擅长那个话题,但据我了解 - 这是 AWS 端负载均衡器的 URL-地址 (FQDN),稍后转发到某个 IP 地址,可以定期更改。

因此,在服务器上已经成功配置了 MS SQL Server 2016 和 SSRS(在本机模式下)。如果使用 URLs http(://)127.0.0.1/reports、http(://)SQL_INSTANCE_NAME/Reports 甚至 http(://)xxx-test-[=41=,一切都在里面工作]-central-1.elb.amazonaws.com/Reports(为此目标已将行“127.0.0.1 localhost xxx-test-xxx.eu-central-1.elb.amazonaws.com”添加到 Windows "hosts" 文件).

现在我正尝试从服务器外部访问 SSRS 门户(还没有任何 SSL 证书,只是通过 HTTPS):

尝试了很多事情,但没有任何帮助: - 在服务器上的防火墙中为入站和出站连接打开 80 端口 - 在注册表中禁用 DisableLoopbackCheck - 将 xxx-test-xxx.eu-central-1.elb.amazonaws.com 添加到注册表中的 BackConnectionHostNames - 尝试多次手动编辑 rsreportserver.config,添加 "http(://)xxx-test-xxx.eu-central-1.elb.amazonaws.com/ReportServer" 和

在网络选项卡的浏览器控制台中,有很多内部请求,其中一些请求出现 400 "bad request" 错误 但是问题并没有消失... 请帮助我找到解决方案或至少找到方向。

终于解决了我的问题

在此之前,我多次尝试重新配置所有内容,但无济于事。 然后我看到了https://social.msdn.microsoft.com/Forums/en-US/d2542ebb-61e0-4cf2-84c5-04614db36719/remote-server-returned-an-error-400-bad-request?forum=sqlreportingservices

"The issue seems to be caused by the Reporting Services virtual directories is not configured to use SSL correctly. If the Reporting Services virtual directories are in the same site of the web application, once we configure the application to use SSL, the Internet Informatin Server(IIS) will require the SSRS to use SSL too. To fix the issue, please configure the SSRS to use SSL through Reporting Services Configuration Manager"

然后我做了:

  • 安装了一些 SSL 证书(它甚至可以是另一个 URL 的证书)
  • 将所有内部 IP + URL 映射到 SSRS 服务管理器中的 ReportServer 和 Reports SSRS Web 应用程序,URL 已集成到 SSL 证书
  • 使用 CMD 命令停止 SSRS 服务
  • 从内部侦听端口删除错误匹配的URL:
netsh http add urlacl url=https://xxx-test-xxx.eu-central-1.elb.amazonaws.com:443/ReportServer user="NT SERVICE\ReportServer"
netsh http add urlacl url=https://xxx-test-xxx.eu-central-1.elb.amazonaws.com:443/Reports user="NT SERVICE\ReportServer"
netsh http delete urlacl url=https://"trash URL, which is integrated to SSL certificate":443/ReportServer/
netsh http delete urlacl url=https://"trash URL, which is integrated to SSL certificate":443/Reports
netsh http show urlacl
  • 因为只有正确的结果 URLs 应该在那里
  • 将C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config修改为合适的状态
  • 可能是不必要的步骤: 从 "bin" 子文件夹更改了 ReportingServicesService.exe.config:将“4”作为 DefaultTraceSwitch 值并将 "all:3,http:4" 作为 Components nvalue在 Rstrace 部分
  • 已启动 SSRS 服务。来自服务器外部的连接有效,但带有错误证书的警报。下一步应该是为 URL 生成正确的证书并使用它。