0

I'm having trouble understanding how communication occurs on a linux box if a front facing server like NGINX has been installed.

For example this is my setup.

AWS / EC2 linux based instance

NGINX - front facing server

Node.js / Express - upstream server

In this setup I have no problem communicating past NGINX with ping, curl, Node Package Manager and other tools even without setting an http_proxy environment variable. By default, without any added configuration these tools know how to get past NGINX and onto the internet.

In this common setup why don't I have to set up http_proxy or something similar to allow outside communication? Once NGINX is installed doesn't all traffic go through it?

myNewAccount
  • 569
  • 1
  • 6
  • 19

1 Answers1

1

nginx is a web server, that answers to incoming HTTP / HTTPS requests. Whenever the interface that nginx is listening to can be connected from the public internet, nginx can serve web pages for it.

The access from other servers to internet is dictated by the network setup. In this case, all those servers have default routes to internet, so that their IP packets are forwarded to any public internet address by the edge router in the network.

These two cases are not related.

If there is a firewall on the edge of the network, then you can restrict the access of each internal server.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • Is there a way for me to determine the default route that tools like ping, curl etc. are using to get to the internet? For example my AWS EC2 instances Public IPv4 address is 54.x.x.x. NGINX serves files over port 80 and 443 using that IP. How do I determine the IP / port that tools like ping, curl and Node Package Manager use to communicate? – myNewAccount May 09 '21 at 17:39
  • `ip address` gives you the configuration of network interfaces on a system. `ip route` shows the routing table entries with the default route. – Tero Kilkanen May 10 '21 at 06:04