SSL端口使用Azure的Web站点的node.js? [英] SSL port for Azure Web Site using node.js?

查看:244
本文介绍了SSL端口使用Azure的Web站点的node.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有困难得到部署为Azure的网站以适当的SSL端口上侦听(Azure的环境中)使Node.js应用程序。

在我有超过端口控制的任何其他环境服务的SSL请求是没有问题的,工作的罚款。我不相信这是与应用code(使用前preSS,FYI)的问题。

Azure网站似乎从负载平衡器到任何端口可用,这是在 process.env.PORT 变量设置转发端口80的流量。

我没有看到SSL流量在 process.env 任何相关等价物,尽管有成功装载一个证书到Azure的门户网站指定的网站和它的配置绑定。

我的问题是:我怎么可以配置天青地吐出必要的文件描述符通信端口443

我读过关于如何在云服务的这里,但它似乎并不适用于一个网站。

有关的参考,当我尝试听在任 443 process.env.PORT ,我得到的以下错误:

 应用已经抛出未捕获的异常而终止:
错误:听EACCES
    在errnoException(net.js:901:11)
    在Server._listen2(net.js:1039:14)
    在听(net.js:1061:10)
    在Server.listen(net.js:1127:5)


解决方案

我假设你读过<一个href=\"http://www.windowsazure.com/en-us/develop/net/common-tasks/enable-ssl/\">http://www.windowsazure.com/en-us/develop/net/common-tasks/enable-ssl/‎

如果我理解正确的话,天青会做HTTPS终止为您服务。您的应用程序/服务仍然得到HTTP流量。

不管怎样,你还是要听的 process.env.PORT 。总是。而且总是会得到HTTP流量有(没有使用https)。如果原始客户端使用80端口,Azure的只是做一个直通到你。如果客户使用的443,天青将终止HTTPS打开一个HTTP请求到你。

I'm having difficulty getting a node.js app deployed as an Azure Web Site to listen on the appropriate port for SSL (within the Azure environment).

Serving up SSL requests in any other environment where I have control over the port is no problem and working fine. I don't believe this to be an issue with the app code (using Express, FYI).

Azure Web Sites seem to forward port 80 traffic from the load balancer to whatever port is available, which is set in the process.env.PORT variable.

I don't see any relevant equivalent within process.env for SSL traffic, despite having successfully loaded a cert into the Azure portal for the given Web Site and configured its bindings.

My question is this: how can I configure Azure to spit out the requisite file descriptor for traffic on port 443?

I've read a little on how to configure a worker in a Cloud Service here, but it doesn't seem applicable for a Web Site.

For reference, when I attempt to listen on either 443 or process.env.PORT, I get the following error:

Application has thrown an uncaught exception and is terminated:
Error: listen EACCES
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1127:5)

解决方案

I assume you've read http://www.windowsazure.com/en-us/develop/net/common-tasks/enable-ssl/

If I understand it correctly, Azure will do the https termination for you. Your app/service still gets http traffic.

Regardless, you still need to listen on process.env.PORT. Always. And will always get http traffic there (not https). If the original client used port 80, Azure will just do a pass-thru to you. If the client used 443, Azure will terminate the https and open an http request to you.

这篇关于SSL端口使用Azure的Web站点的node.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆