You want proxy_pass to use http, not https.

On Thu, Aug 16, 2012 at 3:25 AM, Mark Hahn <[email protected]> wrote:

> I'm sorry if this is an nginx question and shouldn't be on this forum.
>  The nginx forum is pretty much dead.
>
> I have nginx front-ending my node server. It has worked well for some
> time. I am now adding ssl to my setup. I want to terminate the SSL at the
> front-end nginx because I've heard that node's HTTPS server is slower.
>  (Correct me if I'm wrong).  My understanding is that terminating SSL in
> nginx means that simple HTTP would be sent to my back-end node server.
>  (Again, correct me if I'm wrong).
>
> I switched nginx to use SSL (see conf file below) and my setup didn't work
> until I also switched my back-end node server to use https.  This doesn't
> seem right.
>
> Stupid Question:  Is it possible to accidentally terminate on both the
> front-end and back-end at the same time?  It doesn't seem like this would
> be possible and it would be the worst of all possible setups.  My current
> setup appears to be set this way.
>
> Here is my nginx conf file.  I would appreciate it if anyone could take a
> quick look and tell me if this should be terminating SSL (converting HTTPS
> to HTTP).
>
> server {
>   listen 80;
>   rewrite ^(.*)$ https://$host$1 permanent;
> }
>
> server {
>   listen 443 ssl;
>
>   ssl on;
>   ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
>   ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
>   ssl_certificate_key /root/domain.key;
>   ssl_certificate /root/domain.crt;
>
>   ssl_session_cache shared:SSL:10m;
>   ssl_session_timeout 10m;
>
>   keepalive_timeout 60;
>
>   location ~ \/(.*images\/.*|.*\.js|.*\.css|.*\.swf)$ {
>     root /ri/src;
>   }
>
>   location ~ \/($|acct|help|login|main|test).* {
>     # node server is listening on port 81
>     proxy_pass https://localhost:81;
>     proxy_redirect off;
>     proxy_set_header X-Real-IP $remote_addr;
>     proxy_set_header Host $host;
>     proxy_set_header X-Forwarded-Proto https;
>   }
>
> }
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to