如何将SSL证书从Apache服务器传输到NGINX服务器


Answers:


5

您需要复制以下文件:

  1. SSL_Certificate.crt
  2. SSL_Certificate.key

从APACHE SSL配置路径到NGINX服务器配置路径。

现在,为您要保护的网站打开Nginx虚拟主机文件。如果需要通过安全(https)和非安全(http)连接访问站点,则每种连接类型都需要一个服务器模块。复制现有的非安全服务器模块并将其粘贴在原始模块下方。然后在下面加粗的行:

server {

listen   443;

ssl    on;
ssl_certificate    /etc/ssl/your_domain_name.crt; (or .pem)
ssl_certificate_key    /etc/ssl/your_domain_name.key;

server_name your.domain.com;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
location / {
    root   /home/www/public_html/your.domain.com/public/;
    index  index.html;
}

}

调整文件名以匹配您的证书文件:

现在重启Nginx。

运行以下命令以重新启动Nginx:

sudo /etc/init.d/nginx restart

以及我们如何找到相关的apache / nginx路径?
trainoasis
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.