Comment on page
Setting up the HTTPS server
You can deploy your server on Elastic Beanstalk, as it supports the deployment of web applications from Docker containers.
The second option is to use Nginx, we already set it up inside the docker container, so you don't have to worry about Configuring it. You just need to follow the steps below:
In order to create a secure connection with the user’s browser, we’ll need to obtain a digital certificate and a private key. Normally, you get the certificate from a certificate authority such as Let’s Encrypt. Make sure to install the certificate using Certbot, which will take care of reconfiguring NGINX for you.
For local development you can also create a self-signed certificate. The only problem is that browsers will show a warning that the “Certificate is not Trusted” when someone visits your website. But for testing on your local machine that’s perfectly fine.
As you can see in your project root directory, we have two main directories,
server. Once you have your certificate and private key, you need to add them to
nginxdirectory with the following names:
cert.pemfor the certificate
key.pemfor the private key
Once you have your private key and ssl certificate in
nginxdirectory, all you need is to build the docker-compose
sudo docker-compose up --build
Note that our default https port is 443, you can change that by replacing the listen port in default.conf, inside server component.