locked
Express and Passport js issue, thinks everyone is same user, browser does not redirect on post route RRS feed

  • Question

  • User1666829011 posted

    Having a very confusing issue with passport and our node/express/react application using a domain name we purchased.

    On our ip address for the server, we can access the app fine, the post for the /login works, each user gets their own passport session, and can use the logout post fine.

    However when we use Microsoft IIS to reverse proxy to http:localhost:3000/ the website will show using the domain, but when we try to login it takes almost 30 seconds before it succeeds, you will have to refresh the page and the user will have their auth and can visit the site. /logout post acts the exact same way. All of the GET routes work just fine.

    The website DNS is pointed to our public ip at port 80. We just want to take the traffic from 80 and send it to the express server at port 3000. However we are not super familiar with IIS.

    This is our whole web.config

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <httpErrors errorMode="Detailed" />
            <directoryBrowse enabled="false" />
            <caching enabled="false" />
            <httpRedirect enabled="false" destination="https://ourwebsite.app/" exactDestination="false" httpResponseStatus="PermRedirect" />
            <rewrite>
                <rules>
                    <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                        <match url="(.*)" />
                        <action type="Rewrite" url="http://localhost:3000/{R:1}" logRewrittenUrl="true" />
                    </rule>
                </rules>
            </rewrite>
            <urlCompression doStaticCompression="true" />
        </system.webServer>
    </configuration>
    

    Friday, April 2, 2021 12:23 PM

Answers

  • User1666829011 posted

    Solved the issue, enable kernel cache was checked, leaving this here for anyone searching this issue in the future.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, April 2, 2021 1:59 PM