2

I am developing an application using Nuxtjs. The application is opening when I try to access the URL 127.0.0.1. However, when I open the application using the URL localhost:5000 then Access to localhost was denied You don't have the authorization to view this page. HTTP ERROR 403.

Previously it was working but not sure what happened now its not working.

BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
  • did you change the default port from 3000 to 5000? – Boussadjra Brahim Jan 04 '22 at 09:15
  • @BoussadjraBrahim Yes I have used following in my `nuxt-config.js` -> ` server: { port: 5000 },` – BATMAN_2008 Jan 04 '22 at 09:16
  • I recently faced the opposite of this issue (localhost works, 127.0.0.1 doesn't) when upgrading to a new computer, didn't look into it much but I feel it's something related to the OS or the hosts file, which OS are you on ? – Jimmar Jan 08 '22 at 00:38
  • @Jimmar Thanks a lot for your response. I am using `MacOs Monterey`. Even in my system previously it was working and recently I upgraded my MacOS after that it's not working. Do you know what shall I do? – BATMAN_2008 Jan 08 '22 at 05:49
  • 1
    check if this resolves your issue, seems there is a change on port 5000 in Monterey https://stackoverflow.com/a/69829313 – Jimmar Jan 08 '22 at 12:39

1 Answers1

4

Providing the answer as it can be useful to someone else in the future:

I was facing the issue in macOS Monterey this is because macOS Monterey introduced AirPlay Receiver running on port 5000. This prevents your web server from serving on port 5000. The receiver already has the port.

The solution is to turn off the AirPlay Receiver by following steps:

Go to System Preferences → Sharing → Untick Airplay Receiver.

BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98