Default Server

NGINX and IP Addresses

When NGINX is set to listen on a port (like port 80 in your default server block), it can be configured to listen on all network interfaces or a specific IP address. If no IP is specified, NGINX listens on all available interfaces (0.0.0.0 for IPv4 or :: for IPv6), which means it can accept connections from any IP address that can route to it, including local and external traffic.

For instance, your default server block:

server {

 listen 80 default_server;

 server_name _;

 root /var/www/html;

 location / {

 return 200 'NGINX Default Response. Server is running.';

 }

}

This configuration listens on port 80 for all network interfaces 

(default_server makes it the default for any unmatched domain names).

Public vs. Local IP

Testing NGINX Locally

Setting Up for Internet Access

To make your NGINX server accessible from the internet: