配置Nginx Plus使其与ssrs(和ntlm)一起用作反向代理

时间:2018-09-10 16:28:32

标签: nginx reporting-services nginx-reverse-proxy ntlm-authentication

我正在尝试使用nginx plus服务器作为在单独计算机上运行的ssrs实例的反向代理。 Nginx托管在Linux(Ubuntu)服务器上; ssrs(当然)在Windows服务器上。直接访问ssrs(无需通过反向代理)即可正常工作。

我的问题是如何针对这种情况正确配置Nginx Plus。这是我的nginx配置文件的相关部分:

upstream reports_backend {
    server a.b.c.d:443;
    ntlm;
}

server {
    ...
    location /Reports {
        rewrite ^/Reports/(.*)? /Reports/$1 break;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Host a.b.c.d;
        proxy_pass https://reports_backend/Reports;
    }

    ...
}

这确实成功连接到服务器a.b.c.d上的ssrs(不是其真实名称),我可以在ssrs Web门户中浏览报告文件夹。单击报告时出现问题。 URI从“ Reports”更改为“ ReportServer”,这使我从Nginx得到了404(找不到)。

我尝试放置与上面类似的另一个位置:

location /ReportServer {
    rewrite ^/ReportServer/(.*)? /ReportServer/$1 break;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header Host a.b.c.d;
    proxy_pass https://reports_backend/ReportServer;
}

此方法的问题在于/ ReportServer代理通过后,它建立了一个新连接,该代理不包含来自/ Reports连接的NTLM身份验证信息。

我曾尝试将/ Reports和/ ReportServer端点放到一个位置,但这并没有帮助(我无法使重写工作正常)。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

好吧,将头发拔了几天之后,我终于开始工作了。原来这不是NGINX设置,而是SSRS设置。在rsreportserver.config中,我必须具有以下设置(类似于自定义身份验证):

<Authentication>
    <AuthenticationTypes>
        <RSWindowsNTLM/>
    </AuthenticationTypes>
    <RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
    <RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
    <EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>

对我来说,关键是将RSWindowsExtendedProtectionLevel设置为Off,现在一切正常。