Nginx Reverse Proxy - HTTPsupport?

I’ve successfully configured Nginx on an Ubuntu 10.04 box, serving up a
dynamic PHP website.
We need to be able to reverse proxy this website, which I’ve also been
able to do, as:

www frontend (nginx reverse proxy)
www1 backend (nginx php webserver)

The intention is to be able to add/remove backend servers at will.

The only issue I have so far, is that the frontend, as configured, does
not proxy SSL requests.
How can I enable this on my configuration?
Please note, the backend server does have functioning SSL config, and
was tested directly to verify both :80 and :443 work as intended.

Thanks!

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

On Tue, Sep 07, 2010 at 01:11:22AM -0400, jlangevin wrote:

The only issue I have so far, is that the frontend, as configured, does
not proxy SSL requests.
How can I enable this on my configuration?

http://nginx.org/en/docs/http/configuring_https_servers.html

Please note, the backend server does have functioning SSL config, and
was tested directly to verify both :80 and :443 work as intended.

You may proxy to SSL:

location / {
proxy_pass https://backend;
}

however, it’s better to leave SSL only on nginx side and proxy SSL to
plain HTTP:

server {
listen 443;
ssl on;
# other ssl stuff

location / {
    proxy_pass   http://backend;
}


Igor S.
http://sysoev.ru/en/

Thanks for your reply Igor!

So I should remove SSL from the backend box, and add to the reverse
proxy?
That’s what I was thinking, but I wasn’t sure if I still needed it on
the backend as well :slight_smile:

Thanks for your response, you’ve been a great help!

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

On Tue, Sep 07, 2010 at 07:38:05AM -0400, jlangevin wrote:

Thanks for your reply Igor!

So I should remove SSL from the backend box, and add to the reverse
proxy?
That’s what I was thinking, but I wasn’t sure if I still needed it on
the backend as well :slight_smile:

Yes, you do not need SSL on the backend.


Igor S.
http://sysoev.ru/en/

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