Nginx on host + nginx in jail - how to setup two servers?

I have one nginx server on my host, whose connected to internet. I have
second nginx in jail, whose has nonroutable ip. I want:

nginx jail —> nginx host —> internet (world)

How I can setup this? Proxy or sth?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,145777,145777#msg-145777

I run a similar setup, its not hard. just proxy_pass on the outermost
server.

On 29/10/2010 18:26, dong wrote:

I have one nginx server on my host, whose connected to internet. I have
second nginx in jail, whose has nonroutable ip. I want:

nginx jail —> nginx host —> internet (world)

How I can setup this? Proxy or sth?
If you really want to run nginx on both machines, then you need to set
up a normal install in the jail machine, and a reverse proxy
configuration on the firewall.

If you can serve all your content from the “jail” version, then you
don’t need the version on the firewall. Simply port forward port 80 to
the port and ip of the “jail” machine. I think you only need to forward
TCP. If you are using https then you will need to forward that port
also.

Regards

Ian

How to set proxy_pass? When I set NAT in pf.conf then sites from nginx
on my host dont working, but sites from jail is working :slight_smile:

Its my pf.conf now:
rdr pass on em0 proto tcp from any to em0 port 80 -> 192.168.1.3 port
80
nat on em0 from 192.168.1.0/24 to any -> 188.x.x.x

192.168.1.3 - its my jail
188.x.x.x its my host

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,145777,146051#msg-146051

server {
listen frontend:80 default_server;
proxy_intercept_errors on;
location / {
proxy_pass http://backend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs