添加SSL配置后Nginx无法启动

时间:2020-07-15 11:35:04

标签: ssl nginx

添加SSL配置后,我的nginx服务器无法启动。最初仅使用HTTP即可正常运行。错误代码为:

-- A start job for unit nginx.service has begun execution.
--
-- The job identifier is 1562. Jul 15 13:24:27 nginx nginx[3063]: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/STAR_xxxxxxx_be.crt:39 Jul 15 13:24:27 nginx nginx[3063]: nginx: configuration file /etc/nginx/nginx.conf test failed Jul 15 13:24:27 nginx systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStartPre= process belonging to unit nginx.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1. Jul 15 13:24:27 nginx systemd[1]: nginx.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit nginx.service has entered the 'failed' state with result 'exit-code'. Jul 15 13:24:27 nginx systemd[1]: Failed to start A high performance web server and a reverse proxy server.

我看不到错过一个;或)在我的配置文件中:

upstream minio_servers {
    server minio1:9000;
    server minio2:9000;
    server minio3:9000;
}
server {
 listen 80;
 server_name nginx;
 return 301 https://object.xxxxxxx.be$request_uri;
}

server {
 listen 443 ssl;
 server_name nginx;
 ssl_certificate      STAR_xxxxx_be.crt;
 ssl_certificate_key  server.key;
 ssl_protocols        TLSv1 TLSv1.1 TLSv1.2;
 ssl_ciphers          HIGH:!aNULL:!MD5;

 # To allow special characters in headers
 ignore_invalid_headers off;
 client_max_body_size 0;
 # To disable buffering
 proxy_buffering off;
 location / (
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header Host $http_host;
   proxy_connect_timeout 300;
   proxy_http_version 1.1;
   proxy_set_header Connection "";
   chunked_transfer_encoding off;
   proxy_pass http://minio_servers; 
 }
}

你知道可能是什么问题吗?

0 个答案:

没有答案