0

I'm attempting to use an nginx plus server as a reverse proxy for an ssrs instance running on a separate machine. Nginx is hosted on a linux (Ubuntu) server; ssrs is (of course) on a Windows server. Accessing ssrs directly (without going through the reverse proxy) works fine.

My question is how to properly configure Nginx Plus for this situation. Here is the relevant part of my nginx configuration file:

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;
    }

    ...
}

This does connect to ssrs on server a.b.c.d (not its real name) successfully and I can navigate the report folders in the ssrs web portal just fine. The problem comes when clicking on a report. The URI changes from "Reports" to "ReportServer" which gives me a 404 (not found) from Nginx.

I've tried putting in another location defined similarly to the above:

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;
}

The problem with this approach is that it makes a new connection when following the /ReportServer proxy pass, which doesn't contain the NTLM authentication information from the /Reports connection.

I've tried putting the /Reports and /ReportServer endpoints together in one location, and that didn't help (I couldn't get the rewrites to work properly).

Any ideas?

4

1 回答 1

0

好吧,在拔掉头发几天后,我终于让它起作用了。原来这不是 NGINX 设置,而是 SSRS 设置。在 rsreportserver.config 我必须有以下设置(类似于自定义身份验证):

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

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

于 2018-09-17T13:00:53.587 回答