How to install SSL VPS server(Optional)
Lets encrypt is best package to install SSL in the VPS server.
SSL certificate generation
Please run the following command in order to create SSL certificate
sudo docker-compose run --rm certbot certonly --webroot --webroot-path
/var/www/certbot/ --email youremail@gmail.com --agree-tos --no-eff-email -d your
domain
You have to generate the ssl certificate for both frontend and admin panel. So you have to run the command above twice with your email and frontend and admin panel.
SSL certificate in NGINX configuration file
Edit the NGINX configuration by running
nano nginx/config/default.conf
Now you have to create server block for https for both frontend and admin panel. and put all your code there with the following two lines in https block.
ssl_certificate /etc/letsencrypt/live/your server name/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your server
name/privkey.pem;
Redirecting all the https request to https
Now put the below line at the end of http block
location / { return 301 https://$server_name$request_uri; }
Important: Please don't forget the update the links of .env and config.json file with https. Which you have configured in previous steps.