# Setting up the HTTPS server

## Option 1 : ELB

With [AWS Elastic Beanstalk](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html), you can quickly deploy and manage applications in the AWS Cloud without having to learn about the infrastructure that runs those applications.

If you are not familiar with ELB, you can see [Getting started using Elastic Beanstalk](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.html).

You can deploy your server on Elastic Beanstalk, as it supports the deployment of web applications from Docker containers.

In order to deploy your server using Elastic Beanstalk, you can follow the official [AWS tutorial for deploying applications from Docker containers](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.html).

Once you have your server deployed on Elastic Beanstalk, you can follow up with [AWS official Configuring HTTPS with Elastic Beanstalk tutorial](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https.html).&#x20;

## Option 2 : Nginx

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:

#### 1- Adding certificate and key

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](https://letsencrypt.org/). Make sure to install the certificate using [Certbot](https://certbot.eff.org/instructions), which will take care of reconfiguring NGINX for you.

{% hint style="info" %}
For local development you can also [create a self-signed certificate](https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-nginx-for-ubuntu-12-04). 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.
{% endhint %}

As you can see in your project root directory, we have two main directories, `nginx` and `server`. Once you have your certificate and private key, you need to add them to `nginx` directory with the following names:

* `cert.pem` for the certificate &#x20;
* `key.pem` for the private key

#### 2- Building docker-compose

Once you have your private key and ssl certificate in `nginx` directory, all you need is to build the docker-compose

```
 sudo docker-compose up --build
```

**That’s it!**

Now, if you access [https://localhost:443](https://localhost), your connection will be secure.

{% hint style="info" %}
Note that our default **https** port is **443**, you can change that by replacing the listen port in **default.conf**, inside server component.
{% endhint %}

For more information, check out [Configuring HTTPS servers with NGINX](http://nginx.org/en/docs/http/configuring_https_servers.html).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zerowallet.org/setting-up-the-https-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
