Egg: https的配置和启动方法

Created on 4 Dec 2018  ·  4Comments  ·  Source: eggjs/egg

  • Node Version:
  • Egg Version:
  • Plugin Name:
  • Plugin Version:
  • Platform:
  • Mini Showcase Repository:

文档中没有https的配置和启动方法,希望能提供。

Most helpful comment

先看这个,更详细的文档后面补吧~

  // https
  if (options.https) {
    if (is.boolean(options.https)) {
      // TODO: compatible options.key, options.cert, will remove at next major
      deprecate('[master] Please use `https: { key, cert }` instead of `https: true`');
      options.https = {
        key: options.key,
        cert: options.cert,
      };
    }
    assert(options.https.key && fs.existsSync(options.https.key), 'options.https.key should exists');
    assert(options.https.cert && fs.existsSync(options.https.cert), 'options.https.cert should exists');
  }

All 4 comments

  • 一般建议在 SLB 层做 HTTPS 的卸载
  • egg 里面,通过 egg-scripts 可以透传参数给 egg-cluster,可以看下 egg-cluster README 的 options 入参。

cc @thonatos 补一份到文档吧。

先看这个,更详细的文档后面补吧~

  // https
  if (options.https) {
    if (is.boolean(options.https)) {
      // TODO: compatible options.key, options.cert, will remove at next major
      deprecate('[master] Please use `https: { key, cert }` instead of `https: true`');
      options.https = {
        key: options.key,
        cert: options.cert,
      };
    }
    assert(options.https.key && fs.existsSync(options.https.key), 'options.https.key should exists');
    assert(options.https.cert && fs.existsSync(options.https.cert), 'options.https.cert should exists');
  }

Please update the document quickly QAQ

@hnliyuan PR is welcome.

Was this page helpful?
0 / 5 - 0 ratings