Search code examples
expressnestjsswagger-uibasic-authenticationnestjs-swagger

This site can’t be reached The web page at express-basic-auth for swagger ui


I am trying to protect my swagger UI URL with express-basic-auth and it worked pretty fine locally in the nestjs server but when I uploaded it to my ubuntu vps it made accessing the swagger UI page not possible and chrome is showing this error

This site can’t be reachedThe web page at http://mydomain/docs might be temporarily down or it may have moved permanently to a new web address.
ERR_TOO_MANY_RETRIES

Here is how I implemented it

  app.use(
    '/docs*',
    expressBasicAuth({
      challenge: true,
      users: {
        user: 'password',
      },
    }),
  );

Solution

  • well, Chrome uses this error message This site can’t be reached The web page at HTTP:.. might be temporarily down or it may have moved permanently to a new web address. As a catch-all description for a lot of errors, it indicates that Chrome is unable to establish a connection to the website you're trying to access.

    these are some steps to fix this error :

    1 - Check Internet Connection .

    2 - try it on incognito window if it works then go back to your Chrome and Clear Browser Cache (Sometimes, cached data in your browser can cause issues with accessing websites) and disable all extensions

    3 - Change Your DNS Servers

    4 - Disable your firewall and antivirus.