Michael S.
Michael S.

Reputation: 126

nginx uninstalled, localhost:8080 still showing nginx welcome page

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:

I'm on macos High Sierra.

Thanks!

Upvotes: 4

Views: 6556

Answers (4)

Anightingale
Anightingale

Reputation: 61

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?

Upvotes: 4

Evans Gacheru
Evans Gacheru

Reputation: 1

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.

Upvotes: 0

Naresh
Naresh

Reputation: 115

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

Upvotes: 1

Chagai Wild
Chagai Wild

Reputation: 2163

use --force flag.

brew uninstall nginx nginx-common --force

Upvotes: 2

Related Questions