这条命令会同时生成一个key文件和一个证书文件,这期间会提示很多问题让你填写,大部分都可以忽略,不过最重要的Common Name 不能忽略,
你需要填写你的域名。类似下面这样:
1
2
3
4
5
6
7
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:New York City
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Bouncy Castles, Inc.
Organizational Unit Name (eg, section) []:Ministry of Water Slides
Common Name (e.g. server FQDN or YOUR name) []:api.enzhico.net
Email Address []:admin@your_domain.com
server{listen443http2ssl;listen[::]:443http2ssl;server_nameapi.enzhico.net;ssl_certificate/etc/ssl/certs/nginx-selfsigned.crt;ssl_certificate_key/etc/ssl/private/nginx-selfsigned.key;ssl_dhparam/etc/ssl/certs/dhparam.pem;######################################################################### from https://cipherli.st/ ## and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html #########################################################################ssl_protocolsTLSv1TLSv1.1TLSv1.2;ssl_prefer_server_cipherson;ssl_ciphers"EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";ssl_ecdh_curvesecp384r1;ssl_session_cacheshared:SSL:10m;ssl_session_ticketsoff;ssl_staplingon;ssl_stapling_verifyon;resolver8.8.8.88.8.4.4valid=300s;resolver_timeout5s;# Disable preloading HSTS for now. You can use the commented out header line that includes# the "preload" directive if you understand the implications.#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";add_headerStrict-Transport-Security"max-age=63072000; includeSubdomains";add_headerX-Frame-OptionsDENY;add_headerX-Content-Type-Optionsnosniff;################################### END https://cipherli.st/ BLOCK ###################################root/usr/share/nginx/html;location/{}error_page404/404.html;location=/404.html{}error_page500502503504/50x.html;location=/50x.html{}}
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/admtest.enzhico.cn/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/admtest.enzhico.cn/privkey.pem
Your cert will expire on 2018-03-28. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/xncoding.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/xncoding.com/privkey.pem
Your cert will expire on 2018-06-24. To obtain a new or tweaked
version of this certificate in the future, simply run certbot-auto
again. To non-interactively renew *all* of your certificates, run
"certbot-auto renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
[error] 24267#0: *34 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking,
[error] 24267#0: *35 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking,
[error] 24267#0: *36 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking,
[error] 24267#0: *37 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking,