2015-05-20 92 views
0

如何將我的http請求重定向到https?雖然這是一個常見問題,但我沒有看到spray io的任何解決方案。將http請求重定向到https(噴塗io/scala)

  • 我已經啓用ssl使用Apache CamelSslConfiguration它工作得很好。
  • 我設置端口轉發(iptables的)80 - > 8081和443 - > 8081

下面是我Boot.scala文件

object Boot extends App with CamelSslConfiguration with ApiScheduler { 

    // we need an ActorSystem to host our application in 
    implicit val system = ActorSystem("on-spray-can") 

    // create and start our service actor 
    val service = system.actorOf(Props[ApiServiceActor], "api-service") 

    implicit val timeout = Timeout(50.seconds) 
    // start a new HTTP server on port 8080 with our service actor as the handler 
    IO(Http) ? Http.Bind(service, interface = "0.0.0.0", port = 8081) 
} 

回答

相關問題