ARR and URL rewrite for node express website for iis server

I have an express.js website running on my localhost in my Webserver (IIS8.5). When I use ARR and url rewrite to point to localhost port 3000 where my express website is, I can access part of it from the Internet.

Also, the style sheet does not seem to render.

For example:

When I type in mywebsite/Nodewebsite/ – that works but style sheet does not render

When I type in mywebsite/Nodewebsite/blog – that works but style sheet does not render

When I type in mywebsite/Nodewebsite/admin – I get my admin page but when I try to log on I get a 404 err.

My express.js mvc website has a couple of pages (a blog) and When I try to update the content in my blog from my admin page, it shows a 404 error and when I check the URL, the path is not right.

This is the tutorial I followed : http://code.tutsplus.com/tutorials/build-a-complete-mvc-website-with-expressjs–net-34168. It works fine from my server with localhost.

I am so confused on what the issues may be on why part of the express.js site would work but not other parts. But I am suspecting it has to do with my URL rewrite but I am not sure.

Here is my web.config file:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="(.*)" />
                <action type="Rewrite" url="http://127.0.0.1:3000/{R:1}" />
                <conditions logicalGrouping="MatchAny" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>

Hopefully someone can shed some light into this, thanks.

Answer

Attribution
Source : Link , Question Author : webLearner , Answer Author : Community

Leave a Comment