2

I have an Angular 7 application I am hosting on IIS 7, which should be accessible at https://example.com/fitcbooks/web. This was working, then suddenly stopped - for reason I can't seem to understand. The URL Rewrite on the server seems to be working (used to redirect other sites on same server) but it just breaks down for this particular app.

I HAVE ALREADY INSTALLED URL REWRITE MODULE 2 for IIS7. I also built the angular application using --base-ref and already used the web.config code as shown below. I have also built a local version of the app and it works perfectly on my macbook running AMPPS, eliminating any issues in the app itself. This looks like a server problem.

web.config:

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Angular Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="/fitcbooks/web/index.html" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

index.html:

<base href="/fitcbooks/web/">

Currently the app's preloader just loads forever. The console shows several 500 (URL Rewrite Module Error.) errors. Please kindly help.

2
  • Use a tool like Fiddler to grab the complete 500 error page, and then see what it says. Commented Jun 21, 2019 at 16:49
  • Thanks for the tip @LexLi. I installed Fiddler but didn't really get around to reading the HTTPS 500 details. Eventually used IIS' Failed Request Tracing Rules to setup logs, which I later examined. Your comment helped to point me in that direction. Commented Jun 22, 2019 at 7:35

1 Answer 1

1

Finally solved this!

The problem was the automatic encryption of files zip-compressed on mac. I just switched from Windows to Mac because of iOS development last week, so I'm new to this.

I was able to figure this out by reading the details of the 500 HTTP error using Failed Request Tracing Rules in IIS (thanks to @LexLi for the Fiddler tip). I observed the logs and discovered that the specific Error was 500:50. Also found ErrorCode Access is denied. (0x80070005), which made me realize it had something to do with access to the file. After some online digging, I found this forum post (https://forums.iis.net/t/1164360.aspx), installed Process Monitor and saw that clearly, the Server couldn't access the app's files.

The folders in the app had green labels, so I realized they were encrypted. I re-uploaded the files without encrypting and that was it - the app was working! So I learned the hard way that files compressed on a mac might give you problems on windows.

Just putting this out here in case it helps someone else.

Sign up to request clarification or add additional context in comments.

1 Comment

You'll really love Wireshark too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.