I am a newbie to nginx. My problem is the default page is not showing on the browser even if nginx seems to be running.
My environment is bash ubuntu on windows. I have installed nginx with realip module successfully, at least that is what it said on completion of installation.
Started sudo service nginx start
I checked in the task manager that nginx is running and it is.
I run sudo netstat -plunt on the bash it shows the following
/etc$ sudo netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Also did the following
/etc$ ps waux |grep nginx
root 164 0.0 0.0 0 0 ? Ss 2433 0:00 nginx: master pr
babbbsa+ 171 0.0 0.0 0 0 ? S 2433 0:00 grep --color=auto nginx
The default config in etc/nginx/sites-enabled/default rightly includes all the relevant config except that I commented the line with [::]:80 following suggestions to resolve failing nginx run with port 80 already in use message. Namely : (nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use))
server {
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
After running nginx on ubuntu I opened the browser to see the default page using localhost. To be precise I used the following:
http://localhost/
also tried it with:
http://localhost:80
http://x.x.x.x # where x.x.x.x is my IPv4adress
http://x.x.x.x:80 # where x.x.x.x is my IPv4adress
In all cases, no error page or no default nginx welcome page is showing. Simply the page hangs with waiting for localhost ... message on the status bar.
I have visited Freshly installed nginx not serving default page and also here https://serverfault.com/questions/726546/what-are-the-first-steps-to-debug-nginx-default-page-not-showing-on-fresh-ubuntu but the solution is given do not address my issue. Here Having trouble running nginx on EC2 instance it was discussed that the problem might be related to incorrectly set security policies. To fix this it was suggested that " ... go into 'the' security groups and make one that has port 22 open, port 80 open, and port 443 open (HTTPS) .." if this is a solution to my problem (not that I am not running nginx -on -ec2 instance but just in case if the issue is security I mentioned this to show that I have also seen this) how do I set my security group and open the ports? Note that I am working on windows bash ubuntu and if someone knows the solution to my problem please be explicit about how to go about addressing it. Thank you!