1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| curl https://get.acme.sh | sh -s email=username@example.com
source ~/.bashrc
acme.sh --upgrade --auto-upgrade
acme.sh --set-default-ca --server letsencrypt
acme.sh --issue -d mydomain.com --nginx
acme.sh --issue -d mydomain.com --apache
acme.sh --install-cert -d domain.com \ --cert-file /path/to/certfile/in/apache/cert.pem \ --key-file /path/to/keyfile/in/apache/key.pem \ --fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \ --reloadcmd "service apache2 force-reload"
acme.sh --install-cert -d domain.com \ --key-file /etc/nginx/certs/domain.com/key.pem \ --fullchain-file /etc/nginx/certs/domain.com/cert.pem \ --reloadcmd "service nginx force-reload"
server { listen 443 ssl; server_name domain.com; ssl_certificate /etc/nginx/certs/domain.com/cert.pem; ssl_certificate_key /etc/nginx/certs/domain.com/key.pem; location / { proxy_pass http://localhost:1002; proxy_set_header Host $host; 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; } } server { listen 80; server_name domain.com; return 301 https://$server_name$request_uri; }
sudo systemctl restart nginx
|