We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
注意: 本文章是生成 Let's Encrypt 免费HTTPS证书,有效期3个月,需要有域名的所有权,有一台线上服务器。
在服务器中建一个目录
mkdir my_ssl cd my_ssl
openssl genrsa 4096 > account.key
openssl genrsa 4096 > domain.key
openssl req -new -sha256 -key domain.key -out domain.csr
后续过程要输入 域名信息
server { server_name example.com; location ^~ /.well-known/acme-challenge/ { alias /home/xxx/www/my-ssl/; try_files $uri =404; } location / { rewrite ^/(.*)$ https://yoursite.com/$1 permanent; } }
wget https://raw.githubusercontent.com/diafygi/acme-tiny/master/acme_tiny.py
python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir ~/www/challenges/ > ./signed.crt
wget -O - https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem > intermediate.pem --no-check-certificate
cat signed.crt intermediate.pem > chained.pem
wget -O - https://letsencrypt.org/certs/isrgrootx1.pem > root.pem --no-check-certificate
cat intermediate.pem root.pem > full_chained.pem
server { listen 443 ssl; server_name example.com; ssl_certificate ~/www/my-ssl/chained.pem; ssl_certificate_key ~/www/my-ssl/domain.key; location / { proxy_pass http:/example.com; } }
The text was updated successfully, but these errors were encountered:
/xxx/nginx/sbin/nginx -c /xxx/nginx/conf/nginx.conf /xxx/nginx/sbin/nginx -s stop
Sorry, something went wrong.
user root; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name example.com www.example.com; location / { proxy_pass http://127.0.0.1:8080; } location ^~ /.well-known/acme-challenge/ { alias ~/example.com/ssl/; try_files $uri =404; } } server { listen 6001; server_name localhost; location / { root ~/example.com/web/; index index.html; } } server { listen 443 ssl; server_name example.com; ssl_certificate ~/example.com/ssl/chained.pem; ssl_certificate_key ~/example.com/ssl/domain.key; location / { proxy_pass http://example.com; } } }
No branches or pull requests
生成HTTPS证书
创建帐号
在服务器中建一个目录
mkdir my_ssl cd my_ssl
openssl genrsa 4096 > account.key
创建 CSR 文件
openssl genrsa 4096 > domain.key
后续过程要输入 域名信息
配置 Nginx 验证服务
获取网站证书
结合中间证书和网站证书
wget -O - https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem > intermediate.pem --no-check-certificate
cat signed.crt intermediate.pem > chained.pem
结合根证书和中间证书
wget -O - https://letsencrypt.org/certs/isrgrootx1.pem > root.pem --no-check-certificate
cat intermediate.pem root.pem > full_chained.pem
配置Nginx
The text was updated successfully, but these errors were encountered: