问题
I uninstalled nginx from brew using brew uninstall nginx
, but when I go to http://localhost:8080
, I still get the "Welcome to Nginx" message.
What I already did:
- Restarted my computer (3 times)
- Removed extra nginx folder using
rm -rf /usr/local/etc/nginx
- Looking for nginx everywhere from root folder using
sudo find / -name "nginx"
. Nothing shows up. - Looking for nginx .plist files in
/Library/LaunchAgents/
and~/Library/LaunchAgents/
but there's none.
I'm on macos High Sierra.
Thanks!
回答1:
use --force
flag.
brew uninstall nginx nginx-common --force
回答2:
Had this annoying problem as well, discovered it was the httpd package that also made this page appear even after nginx was uninstalled.
Though forcefully shutting down/uninstalling httpd would resolve the issue on the surface, the root issue is actually the fact that generic start file at usr/local/var/www/index.html
, has been hard-coded to contain the "Welcome to nginx" message and will remain that way even after nginx is uninstalled. The Apache (httpd) service also happens calls that index.html
file upon startup which makes it appear as if it were nginx rendering that file.
Not too sure why nginx doesn't automatically empty the file upon uninstallation but just manually change/remove the contents of that file after uninstalling nginx and your problem should be fixed :)
This post also addresses a similar issue: Brew Install Httpd: Welcome to Nginx?
回答3:
It may be a service running use the below from the command line
$ sudo launchctl list - To see the list of services running
launchctl remove - To remove the service
回答4:
Here's a solution as I was in the same predicament.First run
netstat -anv | egrep -w [.]8080.*LISTEN
I found out that the culprit was /usr/local/opt/httpd/bin/httpd. so I terminated the processes suing.
sudo killall httpd
All was well after that, port 8080 was finally free.
来源:https://stackoverflow.com/questions/51040372/nginx-uninstalled-localhost8080-still-showing-nginx-welcome-page