简体   繁体   English

Cloud Foundry上的HTTPS节点应用程序

[英]HTTPS node app on Cloud Foundry

Is it possible to deploy a node.js app on Cloud Foundry that listens for HTTPS requests on port 443? 是否可以在Cloud Foundry上部署侦听端口443上的HTTPS请求的node.js应用程序?

I can find various references to SSL support in the Cloud Foundry forums, but no actual examples of HTTPS apps. 我可以在Cloud Foundry论坛中找到各种对SSL支持的引用,但没有HTTPS应用程序的实际示例。 The article " Setup SSL on cloudfoundry landscape " seems to indicate that I need to install nginx and use that, but there is not really enough information there to tell me what I need to do. 文章“ 在cloudfoundry landscape上设置SSL ”似乎表明我需要安装nginx并使用它,但是没有足够的信息告诉我我需要做什么。

The SSL connection will terminate at the loadbalancer and then forward the unencrypted HTTP connection to your node app. SSL连接将在负载均衡器处终止,然后将未加密的HTTP连接转发到您的节点应用程序。

Just use https://your-app.cloudfoundry.com instead of http://... 只需使用https://your-app.cloudfoundry.com而不是http:// ...

You don't need nginx in particular, but you do need something capable of listening to a port (which Cloud Foundry will assign at the moment, indicated by the environment variable PORT or, for older versions of Cloud Foundry, VCAP_APP_PORT ). 您根本不需要nginx ,但是您确实需要能够侦听端口的东西(Cloud Foundry目前将分配,由环境变量PORT指示,或者对于旧版本的Cloud Foundry, VCAP_APP_PORT )。 So nginx will work for this purpose, but if you have made a node.js app, the core module http (optionally paired with express ) would be a more natural choice of webserver. 所以nginx 可以用于此目的,但是如果你创建了一个node.js应用程序,那么核心模块http (可选择与express配对)将是webserver的更自然的选择。

Now if your app requires ssl, you'd think that you'd need to configure your webserver (nginx, express, etc.) for HTTPS, but you do not need to do so because Cloud Foundry handles the SSL and passes the decrypted HTTP to your webserver . 现在,如果您的应用需要ssl,您认为您需要为HTTPS配置您的网络服务器(nginx,express等),但您不需要这样做,因为Cloud Foundry处理SSL并传递解密的HTTP到你的网络服务器

So if you are using node.js core modules, use the http , not https module. 因此,如果您使用的是node.js核心模块,请使用http ,而不是https模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在我的 IBM CLoud 中的 PHP Cloud Foundry 应用程序和 Postgre SQL 之间建立连接 - Unable to establish connection between PHP Cloud Foundry app and Postgre SQL in my IBM CLoud Node.Js / Express应用程序,https服务器和nginx - Node.Js / Express app, https server and nginx 在Pivotal Cloud Foundry上设置双向SSL身份验证 - Setting up Two way SSL Authentication on Pivotal Cloud Foundry --skip-ssl-validation选项不能与云代工厂中的uaac一起使用 - --skip-ssl-validation option not working with uaac in cloud foundry Cloud Foundry上的DokuWiki“您的PHP似乎缺少SSL支持” - DokuWiki on Cloud Foundry “Your PHP seems to miss SSL support” 在关键云代工厂中使用受信任的 SSL 证书和 spring 引导 - Use trusted SSL certificate with spring boot in pivotal cloud foundry 使用NodeJS + express在Cloud Foundry应用程序中进行相互身份验证 - Mutual Authentication in Cloud Foundry Application with NodeJS+express 如何在本地安装SSL证书以登录到Pivotal Cloud Foundry - How to install SSL certificate locally for logging into Pivotal Cloud Foundry 如何在Cloud Foundry / Heroku中保留SSL服务器证书以进行验证? - How to keep the SSL server certificate for verification in Cloud Foundry/Heroku? 使用Node JS设置Cloud9 SSL应用程序 - Setting up Cloud9 SSL App with Node JS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM