How can a pair of http servers be configured to both listen on port 80, but on different interfaces on the same server?
Specifically, I would like to run nginx and apache on one machine (CentOS 6) for different applications on different IPs.
I believe that by default Apache binds to 0.0.0.0, responding to requests on all inbound traffic. How could this scenario be implemented?
Best Answer
In Apache, change a
Listen 80
toListen X.X.X.X:80
.In nginx, change a
listen 80;
tolisten Y.Y.Y.Y:80;
.