reverse proxy - IIS public link fails on Error 404 File or directory not found
Problem reported by paul brook - 9/26/2023 at 4:45 PM
Before going even deeper into the weeds on this has anybody got a reverse proxy setup that works with public links?

What I have setup seems to be failing on an outbound rule. There's more below about that.

FileVista version

We have been running FV for several years and have decided to move the web application behind a reverse proxy and I am testing that out with a temporary domain name and TLS certficate.

I setup the proxy on IIS version 10. I can login, navigate, upload and download from the web interface OK.

I modified the base URL to match the domain name I am testing with and when I create a public link it looks OK but when I try to use it to download the file I get the 404 message.

For instance the current setup is http://domainname.com:6060 since we didn't have a subdomain for the fileserver. 

The test environment is using https://files.testdomainname.com. So the public link for the test looks like:

We are using application based logins only. So pretty simple.

Here is the inbound rule in the web.config file that forwards the request to FileVista. This works fine for interacting with web pages. Upload files and so on work as expected.

<rule name="InboundForWebfileserver02" stopProcessing="true">
                    <match url="(.*)"/>
                        <add input="{SERVER_NAME}" pattern="^files" />
                    <action type="Rewrite" url="http://webfileserver02:6060/{R:0}" />
                        <set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
However, whenever I test the public url - which looks fine - the 404 error occurs. When I looked at the Failed Request Trace log the process gives up in the precondition of an outbound rule and there is no record of the inbound rule even executing.

Here's the outbound web.config section.

<rule name="OutboundFromWebfileserver02" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Form, Img"
                        pattern="^http(s)?://webfileserver02:6060/(.*)" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
                    <action type="Rewrite" value="http{R:1}://files.testdomainname.com/{R:2}" />
                <rule name="OutboundRestoreAcceptEncoding"
                    <match serverVariable="HTTP_ACCEPT_ENCODING" pattern="‘^(.*)’" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
                    <action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    <preCondition name="NeedsRestoringAcceptEncoding">
                        <add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />

1 Reply

Reply to Thread
paul brook Replied
Marked As Resolution
gave up on IIS and I am now trying out nginx. I am able to download from a public link no problem. Now I need to flesh out the whole configuration with TLS and certificates. 
I am using a very vanilla configuration I found on a MS site-->Scroll down Configure Nginx

Reply to Thread