如何在play框架中禁用http端口? [英] How to disable http port in play framework?
本文介绍了如何在play框架中禁用http端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用https端口运行Play Framework时,应用程序在两个端口上启动 - 默认(9000)和https(443)。
如何禁用默认9000端口并仅在https端口上运行Play应用程序?
When I run Play Framework using https port, application starts on two ports - default (9000) and https (443). How to disabled default 9000 port and run the Play application ONLY on https port?
我通过以下命令运行应用程序:
I run application through the following command:
play -Dhttps.port=443 -Dhttps.keyStore=/path/to/keystore -Dhttps.keyStorePassword=password start
我得到一些日志:
[info ] play - 应用程序启动(Prod)
[info] play - 监听
HTTP on / 0:0:0:0:0:0:0:0:9000
[info] play - 在
port / 0上收听HTTPS:0:0:0:0:0:0:0:443
[info] play - Application started (Prod)
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
[info] play - Listening for HTTPS on port /0:0:0:0:0:0:0:0:443
推荐答案
尝试使用 http.port =禁用标志
play -Dhttp.port=disabled -Dhttps.port=443 -Dhttps.keyStore=/path/to/keystore -Dhttps.keyStorePassword=password start
这篇关于如何在play框架中禁用http端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文