本文介绍了具有SSL的Express + CloudFlare的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用 express appName
刚创建的Express应用程序.我已将端口更改为443.该域位于启用了SSL的CloudFlare代理下.但是,当我进入网站时,我得到了CloudFlare页面 Web服务器已关闭
,而不是看到快速索引页面.
I have an express app freshly created using express appName
.I've changed the port to 443.The domain is under CloudFlare's proxy with SSL enabled.When I go to the website though, I get the CloudFlare page Web server is down
instead of seeing the express index page.
我如何使Express与CloudFlare的SSL一起使用?
How can I make Express work with CloudFlare's SSL?
推荐答案
有两个选项:
- 您需要更改您的应用程序,使其能够接受HTTPS连接而不是HTTP.您可以使用 HTTPS库而不是HTTP来实现.
- 您可以切换到灵活SSL而不是完全SSL,但是对于许多应用程序不建议这样做,因为这意味着从Cloudflare的Edge到Origin的连接是未加密的.
- You need to alter your app such that it is able to accept HTTPS connections instead of HTTP. You can do this by using the HTTPS library instead of HTTP.
- You can switch to Flexible SSL instead of Full, but this is not recommended for a lot of applications as it means the connection from Cloudflare's Edge to your Origin is unencrypted.
这篇关于具有SSL的Express + CloudFlare的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!