If I to the browser on my Laptop and go to 192.168.X.X:80 (ip of raspberry pi), then i receive the error
404 page not found
If I go to 192.168.X.X:81 which is also unused I receive the chrome error
This site can’t be reached
192.168.X.X refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
I setup a nginx on the raspberry pi which is working for all other ports (e.g. 70, 444, 500, 8080) but if I want to assign something to 80 or 443 it is ignored and I receive the 404.
These errors appear if I have no configuration for port 80 and 81. Now I add a configuration for port 80 and 81 to my nginx
server{
listen *:81;
server_name _;
root /home/admin/code/minikube;
index index.html;
location / {
index index.html;
}
}
server{
listen *:80;
server_name _;
root /home/admin/code/minikube;
index index.html;
location / {
index index.html;
}
}
Now port 81 returns the html but 80 still returns the 404.
the command sudo netstat -tulpn | grep ":80" (or 443) has this output
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3825281/nginx: mast
this is the same thing as i receive for 81
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 3825281/nginx: mast
the nginx config looks like this
if I remove the 80 and restart the nginx server I still get the 404 in the browser but nothing appears with netstat command. This confuses me since a 404 means that something has to be running on this port but netstat shows nothing.
How can I bind something on port 80 with nginx and the change has a affect?