我正在尝试使用Nginx ver 1.4.7和Phusion Passenger 4.0.41在我的ubuntu服务器上设置https.
我使用这两个命令创建了.key和.csr
sudo openssl genrsa -des3 -out server.key 2048
sudo openssl req -new -key server.key -out server.csr
并将.csr发送给sslshopper.com伙伴们
有3个文件:
Root CA Certificate - AddTrustExternalCARoot.crt
Intermediate CA Certificate - USERTrustSecureServerCA.crt
Your COMODO SSL Certificate - subdomain_domain_com.crt
这就是我的Nginx.conf现在的样子
http {
passenger_root /usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41;
passenger_ruby /usr/local/rvm/gems/ruby-2.1.1/wrappers/ruby;
server_names_hash_bucket_size 64;
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
server {
listen 443 default ssl;
ssl on;
ssl_certificate /opt/Nginx/ssl/subdomain_domain_com.crt;
ssl_certificate_key /opt/Nginx/ssl/server.key;
server_name app.petosevic.com;
root /var/www/petosevic/public;
passenger_enabled on;
location / {
# set X-FORWARDED_PROTO so ssl_requirement plugin works
proxy_set_header X-FORWARDED_PROTO https;
# standard rails+mongrel configuration goes here.
}
}}
当我尝试启动服务器时,我需要输入我在创建.key文件时输入的密码.什么时候被接受,我收到错误:
Nginx: [emerg] SSL_CTX_use_PrivateKey_file("/opt/Nginx/ssl/server.key") Failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)
我100%确定我向sslshopper.com发送了正确的.csr文件,但看起来他们不匹配.
你怎么看待这件事?
最佳答案
原文链接:https://www.f2er.com/nginx/435685.html