我有一個Phoenix/Elixir應用程序,可以在本地使用https進行正常工作,但是當我嘗試將其更改爲使用生產證書時,服務器不響應並且不顯示任何錯誤消息。Phoenix在本地工作但不在生產中使用SSL
In my dev.exs this was made with the hostname localhost
In prod.exs here are the keys. These were made with my production URL
我曾嘗試通過在配置
https: [port: 443,
host: "produrl.com"
keyfile: "priv/keys/domain.key",
certfile: "priv/keys/domain.crt"],
這會引發錯誤添加主機到HTTPS部改變localhost來生產網址上本地 sudo MIX_ENV=prod mix phoenix.server [info] Running LiteChartBe.Endpoint with Cowboy using http://localhost:80 [info] Application lite_chart_be exited: LiteChartBe.start(:normal, []) returned an error: shutdown: failed to start child: LiteChartBe.Endpoint ** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Server ** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, LiteChartBe.Endpoint.HTTPS} ** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup ** (EXIT) :badarg {"Kernel pid terminated",application_controller,"{application_start_failure,lite_chart_be,{{shutdown,{failed_to_start_child,'Elixir.LiteChartBe.Endpoint',{shutdown,{failed_to_start_child,'Elixir.Phoenix.Endpoint.Server',{shutdown,{failed_to_start_child,{ranch_listener_sup,'Elixir.LiteChartBe.Endpoint.HTTPS'},{shutdown,{failed_to_start_child,ranch_acceptors_sup,badarg}}}}}}}},{'Elixir.LiteChartBe',start,[normal,[]]}}}"} Kernel pid terminated (application_controller) ({application_start_failure,lite_chart_be,{{shutdown,{failed_to_start_child,'Elixir.LiteChartBe.Endpoint',{shutdown,{failed_to_start_child,'Elixir.Phoeni
如果我只是轉發localhost來produrl我n我的本地主機文件,不會引發錯誤,也不會使用https連接到服務器。