minglyu
minglyu

Reputation: 3337

Nginx shows started in terminal but could not be accessed in browser(Mac OS)

$ brew services list

...
nginx             started root    /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
...

I have installed nginx using brew and started the nginx server using sudo brew services start nginx, I checked the error logs, there is no errors displayed, I changed the listen port to 6666.

But the default nginx page is not showing up in browser, what could be wrong?

Update

Terminal

enter image description here

Firewall enter image description here

Chrome enter image description here

Upvotes: 0

Views: 679

Answers (1)

Alfons Muñoz
Alfons Muñoz

Reputation: 519

Seems like you setup nginx correctly but the browser does not allow you to see the 6666 port for security reasons. If you are using Chrome, you have to quit it (be sure to quit fully with File menu > Quit or Command-Q, don't just close all windows) and then re-open it using the terminal with a specific parameter to allow 6666 port.

open -a "Google Chrome" --args --explicitly-allowed-ports=6666

If that doesn't work check your MacOSX Firewall in "System Preferences" - "Security" - "Firewall", also check if you have an antivirus blocking the connection.

I didn't have to use "sudo" to start the nginx server, only "brew services start nginx"

Upvotes: 3

Related Questions