1

If I set up a virtual host in nginx, will all packets flow through that PC?

Here is what is going on. I have an openwrt NAT router with two devices behind it, a server and a raspberry pi. I want both of them to be accessible to the WAN via subdomains, http://server.example.net and http://raspberrypi.example.net. I know that using a different port number in this situation is the way to go, but nobody else is going to remember that very well, and I'd rather KISS by avoiding numbers. My question is, what if one of these devices ran Nginx with virtual hosts configured to direct subdomain traffic to the appropriate box? It seems practical enough for me, but if the Raspberry Pi is on wifi somewhere in the house, would this cause ALL packet traffic from 'server' to first travel to the Raspberry Pi, then redirect to 'Server'?

Thank you.

1 Answer 1

1

Yes, because nginx would be the reverse proxy in front of your application servers. The HTTP requests would first arrive to the box that runs nginx, and then nginx forwards the requests to desired destination according to virtual host's configuration.

2
  • How then would load balancing happen then if the forward server is still swamped with packets before forwarding them on? Or is this not an issue?
    – mh00h
    Jul 12, 2014 at 16:28
  • 1
    Load balancing is balancing CPU and IO load between multiple servers, it is not about balancing network bandwidth. The reverse proxy load balancing is a cheap operation in terms of computing power and compared to the load of application servers. Jul 13, 2014 at 1:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .