0

I added some modifications to my root@mypage:/etc/nginx/sites-available/default

when I do sudo service nginx restart the server gives back this error: Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

If I run nginx -t -c /etc/nginx/nginx.conf the out put is

Enter PEM pass phrase: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

Can someone advise my about what I'm doing wrong? I'm totally blank here

here is the root@mypage:/etc/nginx/sites-available/default file

 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;

 }

I used this guide https://www.youtube.com/watch?v=D2P5cRMi0fQ and this guide http://nginx.org/en/docs/http/configuring_https_servers.html#optimization for reference during the setup.

5
  • 1
    That Enter PEM pass phrase line is your problem. By default, you won't be able to use services to run nginx if your key has a passphrase on it. Please see stackoverflow.com/questions/33084347/… for some additional reading and solutions.
    – Iskar
    May 29, 2017 at 14:35
  • but it's not asking for it when I do sudo service nginx restart only in nginx -t -c /etc/nginx/nginx.conf
    – Slowboy
    May 29, 2017 at 14:54
  • This would perhaps be better suited on Server Fault
    – Eyeslandic
    May 29, 2017 at 14:59
  • Why the downvote?
    – Slowboy
    May 29, 2017 at 15:28
  • @Slowboy It isn't asking for it because it silently fails itself. Try the stuff in the link I gave, there are some workarounds there for your problem.
    – Iskar
    May 30, 2017 at 8:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.