I would personally advise against this. If you do not properly secure those folders which will now be inside a website folder, you easily give access to anyone on the outside to all your LE information for that site including your privkey.pem and all your .conf files … basically everything.
I’m leaving this thread open, in case any of you want to give me further warnings in case I’m headed for a total disaster - or if you have alternative methods of doing this.
make sure you have in each and every vhost a location directive (example only)
location /letsencrypt_files {
deny all;
}
also look at using global rules in a single file that gets applied to every host then you have one place toe make changes
so have a file like restrictions.conf in /etc/nginx/custom.d/ and in every vhost you simply include that include file include /etc/nginx/custom.d/restrictions.conf;
Then you can have all your default location directives all in one place
Just denying HTTP access is still not enough if the web server itself is compromised. The proper way is for the web server to load the private key, then drop privileges and run as a user that has no access to the private key file.
I completely fail to understand the motivation here. Why is it bad if important things live in /etc? Also your sense of where things “belong” is way off.
Thanks. I will make sure to chown it to root:root.
My goal is to keep all relevant files inside my ~ for more easier backups. I want everything outside ~ to be discardable. This way it’s easier to remember what I need to backup - only stuff inside ~.
Not to me.. There are a lot of things you'd like to backup I recon. Moving everything to a single location defies the POSIX rules about the Filesystem Hierarchy Standard.
--cert-path CERT_PATH
Path to where cert is saved (with auth --csr),
installed from, or revoked. (default: None)
--key-path KEY_PATH Path to private key for cert installation or
revocation (if account key is missing) (default: None)
--fullchain-path FULLCHAIN_PATH
Accompanying path to a full certificate chain (cert
plus chain). (default: None)
--chain-path CHAIN_PATH
Accompanying path to a certificate chain. (default:
None)
The renewal .conf files appear to keep a track of where the cert and private key are