Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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) ?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

"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.

share|improve this answer
add comment

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.

share|improve this answer
    
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? –  Matthias Reisner Mar 9 '12 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 '12 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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