Only your front end service, listening on 443, needs to be https, as it 
will handle decrypting of the client's request.  When you proxy to other 
services, if they're internal/on your own network, there's no reason to use 
https on the back end (just adds a ton of performance overhead), however if 
they're on a public network or for some reason you want additional internal 
security, you can use https, however it will be a https handshake between 
your front end and the back end, *not* between the user's browser and the 
back end (this matters if you need to get at the user's https client 
certificates or something, you'd have to do that on your front end and 
forward appropriate information along).

As for how to do it, it's basically the same whether it's http or https. 
 The simplest is probably going to be to use the http-proxy 
<https://www.npmjs.com/package/http-proxy> module, the examples there 
should work whether you're using "http.createServer" or 
"https.createServer".

I wrote a blog post a while back detailing my solution (which does more 
than just simple proxying, uses express for ease of managing routes, does 
some URL re-writing to just proxy sub-directories transparently, and static 
file serving on the front end).  It's available 
here: https://jimbesser.wordpress.com/2014/10/20/its-node-js-all-the-way-down/

Note that if performance is of the utmost importance, you'll want to use a 
dedicated piece of software designed for this, such as NGINX, last I saw it 
was still significantly faster than a Node app for the specific task of 
https handshake + serve static files + proxy to other services.  But, 
Node's still pretty darn fast, and it's likely other performance 
bottlenecks will far outweigh this difference, and it's nice to have 
everything in the same framework.

Hope this helps!
  Jimb

On Friday, October 30, 2015 at 8:54:35 AM UTC-7, siliconplains wrote:
>
> I need to setup a node.js service that runs on port 443 https, that 
> proxies out to multiple other node.js services that are hosted against 
> differnet ports but all run https.
>
> Does anyone have any examples of how to setup a node proxy server to 
> accmomplish this?  I have exhausted examples online.  I have looked all 
> over the place for an example of how to do this and I find no examples of 
> how to configure this.
>
> Thanks in advance,
> Allan
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/0dc47614-ecb9-4743-a774-f7dd9c138630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to