【问题标题】:How to disable http port in play framework?如何在播放框架中禁用 http 端口?
【发布时间】:2014-09-11 21:40:39
【问题描述】:

当我使用 https 端口运行 Play Framework 时,应用程序在两个端口上启动 - 默认 (9000) 和 https (443)。 如何禁用默认的 9000 端口并仅在 https 端口上运行 Play 应用程序?

我通过以下命令运行应用程序:

play -Dhttps.port=443 -Dhttps.keyStore=/path/to/keystore -Dhttps.keyStorePassword=password start

我得到了一些日志:

[info] play - 应用程序已启动(Prod)
[信息] 播放 - 聆听 HTTP on /0:0:0:0:0:0:0:0:9000
[info] play - 监听 HTTPS 端口 /0:0:0:0:0:0:0:0:443

【问题讨论】:

    标签: java scala playframework playframework-2.0


    【解决方案1】:

    尝试使用 http.port=disabled 标志

    play -Dhttp.port=disabled -Dhttps.port=443 -Dhttps.keyStore=/path/to/keystore -Dhttps.keyStorePassword=password start
    

    【讨论】:

    • 那么production mode 呢? conf文件中的属性应该是什么?
    【解决方案2】:

    很遗憾,这不能在 Gradle Play 插件中以相同的方式完成,请参阅:https://github.com/gradle/playframework/issues/85

    【讨论】:

      猜你喜欢
      • 2017-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-11
      • 2021-08-23
      • 2018-03-05
      • 2016-06-21
      • 2013-11-20
      相关资源
      最近更新 更多