In a production scenario, it will be likely for a Phoenix application to listen to requests using a secure protocol. HTTPS will be used in detriment of plain HTTP.
To accept connections securely, we need to launch the application with SSL support.
Fortunately, in Phoenix, configuring SSL is quite simple.
In a Phoenix application, place the
*.cert files under the
To configure SSL in a Phoenix application, we will need to add the following to the
config :phoenix, Todo.Router, https: [port: 443, host: "example.com", keyfile: System.get_env("YOUR_SSL_KEY_FILE"), certfile: System.get_env("YOUR_APP_SSL_CERT_FILE")],
We insert the configuration ...