# Nginx - "encountered end of file" ..?

**URL:** <https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890>\
**Category:** Server\
**Created:** [February 15, 2017, 7:47am UTC](https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890 "2017-02-15T07:47:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NearlyNormal](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/nearlynormal/32/13594_2.png) [@NearlyNormal](https://community.letsencrypt.org/u/NearlyNormal)\
**Post date:** [February 15, 2017, 7:47am UTC](https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890/1 "2017-02-15T07:47:56Z")

</div>

Hello.

My settings don’t seem to be working. I’ve followed the instructions to generate the LE pem files etc for a few domains. And then also ran the command for additional security:

```
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

```

(Removed private server details as item is solved.)

---

<div class="post-metadata">

**Author:** ![NearlyNormal](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/nearlynormal/32/13594_2.png) [@NearlyNormal](https://community.letsencrypt.org/u/NearlyNormal)\
**Post date:** [February 15, 2017, 8:04am UTC](https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890/2 "2017-02-15T08:04:40Z")

</div>

**Also** : Reading on Stack Overflow etc, I’m surprised the error message says that ssl\_certificate is not defined, because each server block has those lines.

And I checked, these files all exist. Is there some specific permission that’s needed on them? They seem to be 777.

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [February 15, 2017, 8:20am UTC](https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890/3 "2017-02-15T08:20:45Z")

</div>

_Most_ of the HTTPS `server` blocks define certificates. Some of them don't, which makes Nginx unhappy in general.

Also, this may be a copy and paste error, but one server block seems to contain the words "`SSL settings`" (probably a comment with a missing `#`), which would also be bad somehow probably.

Edit: For example, this block:

> [@NearlyNormal](#):
>
> `server { listen 443 ssl http2; server_name www.pennyhart.com; return 301 $scheme://pennyhart.com$request_uri; }`

---

<div class="post-metadata">

**Author:** ![NearlyNormal](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/nearlynormal/32/13594_2.png) [@NearlyNormal](https://community.letsencrypt.org/u/NearlyNormal)\
**Post date:** [February 15, 2017, 8:30am UTC](https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890/4 "2017-02-15T08:30:01Z")

</div>

Thank you so much. Wow, much ado about a typos. It’s late here…thank you thank you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [March 17, 2017, 8:30am UTC](https://community.letsencrypt.org/t/nginx-encountered-end-of-file/27890/5 "2017-03-17T08:30:03Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
