原文链接 https://bysocket.com/nginx-unexpected-end-of-file-expecting-in-key-file/ 一、Nginx unexpected end of file 问题 通过 letsencrypt 申请证书后,默认服务器安装了 Nginx 1.8 Decompiler 发现,在默认的 /etc/nginx/sites-enabled/default 内容配置 SSL 的 site.com.key 后。( Google Maps Scraper ) 重启 Nginx 出现一下错误: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/site.com.key:27 二、定位和解决 上述通过日志发现了这个问题,日常谷歌下,发现都不是在这个问题。普遍的是 conf 文件,少了 “;” or “}” 结尾。我这个提示最关键的是说 SSL key 文件里面存在这个问题,其实 SSL 生成文件没错。 后来发现,原来是默认 nginx 的问题。 […]