
root@david-pc:~/docker/wordpress# certbot –nginx -d cosicosilife.com -d www.cosicosilife.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter ‘c’ to cancel): [email protected]
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.4-April-3-2024.pdf. You must agree in
order to register with the ACME server. Do you agree?
(Y)es/(N)o: Y
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let’s Encrypt project and the non-profit organization that
develops Certbot? We’d like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for cosicosilife.com and www.cosicosilife.com
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/cosicosilife.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/cosicosilife.com/privkey.pem
This certificate expires on 2024-10-28.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for cosicosilife.com to /etc/nginx/nginx.conf
Successfully deployed certificate for www.cosicosilife.com to /etc/nginx/sites-enabled/default
Congratulations! You have successfully enabled HTTPS on https://cosicosilife.com and https://www.cosicosilife.com
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
root@david-pc:~/docker/wordpress#
root@david-pc:~/docker/wordpress#
root@david-pc:~/docker/wordpress# vi /etc/nginx/sites-enabled/default
root@david-pc:~/docker/wordpress# systemctl restart nginx
server {
server_name cosicosilife.com www.cosicosilife.com;
location / {
proxy_pass http://localhost:3001; # WordPressアプリへのプロキシ設定
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;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/cosicosilife.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/cosicosilife.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
listen 80;
server_name ft.cosicosilife.com;
location / {
proxy_pass http://localhost:3002; # 別のアプリへのプロキシ設定
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 {
if ($host = www.cosicosilife.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name cosicosilife.com www.cosicosilife.com;
return 404; # managed by Certbot