An https
template based on nginx + docker
that allows you to quickly deploy https
websites ๐๐๐
You need to have at least, and only, a Docker environment.
- Enter your
repos
directory, which can be any directory (though you might need to make some modifications later). Here, we'll use/root/repos/
as an example. If there is norepos
directory, create one. Thenclone
this project.
cd /root/repos/
git clone https://github.com/Justin3go/nginx-https-template.git
cd nginx-https-template
- Replace the certificates in the
cert/
folder with your own, in the formatyour-domain.key
andyour-domain.pem
. For example, if my domain isjustin3go.com
, then my certificates would bejustin3go.com.key
andjustin3go.com.pem
. - Run the script
./scripts/replace-domain.sh --domain=your-domain
.
sudo chmod -R +x ./scripts # Set script permissions
./scripts/replace-domain.sh --domain=your-domain # Run the script to replace the domain
Note: By default, the
https
forwarding is set to port80
. If your website is not on port80
, you will need to modify theproxy_pass
in/conf.d/default.conf
to your port.
- If you used a custom directory in the first step, then modify the root directory in
docker-compose.yml
to your directory, which by default is/root/repos/
. - Start the container.
./scripts/run.sh
- You can use the
docker ps
command to check if the container is running properly. - And use
tail -n 1000 logs/access.log
andtail -n 1000 logs/error.log
to viewnginx
running logs.