# An error occurs when building Discourse over HTTP

**URL:** <https://meta.discourse.org/t/an-error-occurs-when-building-discourse-over-http/344396>\
**Category:** Self-hosting\
**Created:** [December 26, 2024, 11:15am UTC](https://meta.discourse.org/t/an-error-occurs-when-building-discourse-over-http/344396 "2024-12-26T11:15:34Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ramamang](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@ramamang](https://meta.discourse.org/u/ramamang)\
**Post date:** [December 26, 2024, 11:15am UTC](https://meta.discourse.org/t/an-error-occurs-when-building-discourse-over-http/344396/1 "2024-12-26T11:15:35Z")

</div>

1. Domain configuration completed
2. AWS EC2 instance created
3. Certificate issued using ACM
4. Configured 443 and connected the certificate via ALB
5. ALB routes domain traffic to the EC2 instance on port 80

Before building Discourse, I modified the `app.yml` file to configure HTTP connections:

```plaintext
templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  ## Uncomment the next line to enable the IPv6 listener
  #- "templates/web.ipv6.template.yml"
  - "templates/web.ratelimited.template.yml"
  ## Uncomment these two lines if you wish to add Lets Encrypt (https)
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
  - "80:80" # http
 #- "443:443" # https

```

After making the changes, I built Discourse and checked the configuration, but nginx keeps requesting an SSL key with the following error:

```plaintext
[emerg] 7416#7416: cannot load certificate "/shared/ssl/discourse.xxxxxxx.com.cer": PEM_read_bio_X509_AUX() failed (SSL: error:0480006C:PEM routines::no start line:Expecting: TRUSTED CERTIFICATE)

```

Is there a way to prevent nginx from attempting to load the key or to make nginx work properly over HTTP?

---

_[View the full topic](https://meta.discourse.org/t/an-error-occurs-when-building-discourse-over-http/344396)._
