Nginx在添加ssl后不会重新启动

Nginx在添加ssl后不会重新启动,ssl,nginx,vps,Ssl,Nginx,Vps,我对我的root@mypage:/etc/nginx/sites available/default 当我执行sudo service nginx restart时,服务器返回此错误:nginx.service的作业失败,因为控制进程已退出,并显示错误代码。有关详细信息,请参阅“systemctl status nginx.service”和“journalctl-xe”。 如果我运行nginx-t-c/etc/nginx/nginx.conf输出是 输入PEM密码短语: nginx:配置文件/

我对我的
root@mypage:/etc/nginx/sites available/default

当我执行
sudo service nginx restart
时,服务器返回此错误:
nginx.service的作业失败,因为控制进程已退出,并显示错误代码。有关详细信息,请参阅“systemctl status nginx.service”和“journalctl-xe”。

如果我运行
nginx-t-c/etc/nginx/nginx.conf
输出是

输入PEM密码短语:
nginx:配置文件/etc/nginx/nginx.conf语法正常
nginx:configuration file/etc/nginx/nginx.conf测试成功

有人能告诉我我做错了什么吗?我这里一片空白

这是
root@mypage:/etc/nginx/sites available/default
文件

 server {
    listen 80;
    listen [::]:80 default_server ipv6only=on;

    server_name mypage.com;
    passenger_enabled on;
    rails_env    production;
    root         /home/deploy/mypage/current/public;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
 }

 server {
    listen 443;
    server_name mypage.com;
    passenger_enabled on;
    rails_env    production;
    root         /home/deploy/mypage/current/public;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    ssl                   on;
    ssl_certificate       /etc/ssl/certs/secure.mypage.com.1.2019.chain.crt;
    ssl_certificate_key   /etc/ssl/private/mypage.com.key;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;


    ssl_prefer_server_ciphers     on;
    ssl_session_cache   shared:SSL:10m;
    ssl_session_timeout 10m;

 }

在设置过程中,我使用了本指南和本指南作为参考。

您的问题是
输入PEM密码短语。默认情况下,如果密钥上有密码,您将无法使用服务运行nginx。请参阅以获取更多阅读资料和解决方案。但当我只在
nginx-t-c/etc/nginx/nginx.conf中执行
sudo服务nginx restart
时,它并没有要求重新启动它。这可能更适合于为什么否决?@Slowboy它没有要求,因为它本身会自动失败。试试我给你的链接里的东西,这里有一些解决你问题的方法。