1

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?

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.

2
  • 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 9 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 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.