Answer the question
In order to leave comments, you need to log in
Can two programs work on the same port but on different IPs?
Good afternoon, tell me, please, is it possible to run both Apache2 and nginx on a computer so that they simultaneously listen to the 80th port, but on different IP addresses?
Now nginx gives an error that Cannot assign requested address.
Answer the question
In order to leave comments, you need to log in
In the Nginx config we write:
Documentation
In the Apache config we write:
Documentation
In the browser go to 127.0.0.42 and 127.0.0.43. We observe the difference.
You can, but it's better to hang Apache on port 8888, for example, and proxy to it from port 80 through nginx.
This is a very common configuration, and you won't need to bother with binding to different addresses. Well, the config for the enginx is an order of magnitude simpler ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question