求问:egg.js启动的服务如何设置为https
 发布于 7 年前  作者 justbecoder  4785 次预览  最后一次回复是 7 年前  来自 问答 

egg.js如何设置启动为https的服务?

8 回复
justbecoder

默认启动的是 http://127.0.0.1:7001,如何变成是https://127.0.0.1:7001

shenqidebaozi

推荐用nginx,也可以通过启动参数,使用https

justbecoder

@shenqidebaozi 启动参数如何设置,直接 --https 吗

betty200744

egg-scripts start --daemon --port=443 --https=true

waitingsong
"scripts": {
  "dev": "egg-bin dev --https.key=\"c:/02.key.unsecure\" --https.cert=\"c:/02.crt\""
 }
shenqidebaozi

@justbecoder 多看看文档吧

来自酷炫的 CNodeMD