This was done on Centos 6 where prebuilt ‘certbot’ packages are not available. On Centos 7, install ‘certbot’ from the EPEL repo.
cd ~root;
mkdir certbot;
wget https://dl.eff.org/certbot-auto;
chmod 755 certbot-auto;
./certbot-auto;
This installs packages, including gcc, which you may want to uninstall as it’s bad practice to have compilers on a external facing (public) Web server.
On my server I have a different configuration file for each server we’re proxying for. These are in /etc/nginx/conf.d/ and using a naming convention of:
domainname.domain.conf
For example, example.com would be:
example.com.conf
Edit your config file and add this after location / { … } :
location /.well-known {
alias /tmp/static/.well-known;
}
Then:
mkdir /tmp/static/;
Run certbot:
./certbot-auto certonly
Continue reading Let’s Encrypt Cert & Nginx (Using a Web Proxy) on Centos 6.x