大网数据广告活动
服务器运维问答

Nginx correct SSL Certificate order

· 52CE 我爱测

I got the following files: priv.key // This is my priv key and contains one -----BEGIN ENCRYPTED PRIVATE KEY----- section req.csr // This is my certificate request file cert.pem // This is my certificate I got back per mail and c…

问题原文

原帖链接 · Cracker0dks · CC BY-SA 3.0

I got the following files:

  • priv.key // This is my priv key and contains one -----BEGIN ENCRYPTED PRIVATE KEY----- section

  • req.csr // This is my certificate request file

  • cert.pem // This is my certificate I got back per mail and contains one -----BEGIN CERTIFICATE----- section

  • cacert_sha1.crt // this is the root CA I think

  • chain.txt // dont know whats that for but must be usefull according to some tutorials :)

I tried a lot of stuff and combined the files in a lot of different ways to new .pem files. But I always get a not signed error from the browser when I surf to the website

I always restarted nginx after changing my config.

Does anyone knows how to combine in the correct order/way? Are this all files I need ?

Thanks :)

已采纳解答

原帖链接 · Richard Smith · CC BY-SA 3.0

The ssl_certificate_key directive specifies your private key (that's your priv.key file).

The ssl_certificate directive specifies a file containing a concatenation of your signed certificate (which you call cert.pem), the Certificate Authority and zero or more chain files.

The certificate signing request is not used by nginx.

Care is required when concatenating the certificate files. Your certificate should be first. Also, there is a lot of extra junk in those chain files and I don't know if it gets ignored. You might want to edit the junk out.

See this document for more.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。