0

I'm very confused.

If I setup a Reverse Proxy Server, does this mean that I need a second computer? Or can both Server (e.g. nginx as reverse proxy server and apache as webserver) run on the same computer and different port!?

For example this pic!

enter image description here

it seems to me that there are 4 computers (one for each server) ?

2 Answers 2

2

"A server is a process" said to me a teacher years ago :-)

Both servers can run on the same computer and different ports/IP.

For example you can set apache to

Listen 127.0.0.1:8080

and then nginx point to it

server {
 listen   80;
 location / {
  proxy_pass         http://127.0.0.1:8080/;
 }
}

Note that the above is pseudo-code.

0

See here for a good intro on configuring reverse proxies in apache.

Since a web site is defined by an IP:port combination, nothing prevents you from running multiple instances or virtual hosts on one machine, with one instance pointing to or proxying another.

2
  • G Oh ok i understand. So i always thought the right way.:) @adaptr i already heard about mod_proxy. So i can have the same functionality as i would have with an second Server instance? If i want that all requests should be handled by the proxy server and the direct access point/address is hidden? Mar 9, 2012 at 12:57
  • Yes; a common use of a proxy server is to hide the real origin server from the public internet.
    – adaptr
    Mar 9, 2012 at 14:21

You must log in to answer this question.

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