React + Node + Nginx with Plesk. Part 3
This is the last article about Plesk configuration. Previous one — https://medium.com/@zenbit_tech/react-node-nginx-with-plesk-part-2-dc7aa97a9b9e. In this part, I will describe how to configure a React app and connect ssl certificates to it.
As an example, I will upload a frontend part to a subfolder. To make it work in react app, add "homepage": "https://domain_name/subfolder"
to package.json.
Create a domain name in Plesk panel and add "subfolder"
to your domain root folder. Then upload all files from build
folder to subfolder
using the file manager (you need to zip your file first) or via ftp client.
The next step is to configure nginx and to redirect it to index.html. You can do it in Apache & Nginx settings
.
And the last thing is to add these lines in the Additional ngnix directives
input.
location ^~ /subfolder {
alias /var/www/vhosts/domain_name/root_folder/subfolder;
try_files $uri $uri/ /subfolder/index.html;
}
That’s all.
To connect ssl certificates use SSL/TLS Certificates
menu item. Use upload certificates
button to upload your certificates or use Let's Encrypt SSL/TLSCertificate
to create a new certificate.