Deploying a React Application with Nginx on Ubuntu

preview_player
Показать описание
You can quickly deploy React applications to a server using the default Create React App build tool. The build script compiles the application into a single directory containing all of the JavaScript code, images, styles, and HTML files. With the assets in a single location, you can deploy to a web server with minimal configuration.

In this tutorial, you’ll deploy a React application on your local machine to an Ubuntu 20.04 server running Nginx.

Pre-installation
It is necessary that Node.JS is installed on your server versions of Node.JS above 14.
Nginx is also installed and server blocks are configured

Commands used
npx create-react-app mivo-deploy
cd mivo-deploy
npm start
npm run build
cat /etc/nginx/sites-enabled/your_domain

Useful links
Рекомендации по теме
Комментарии
Автор

Today, you saved my job with your videos! I want to express my heartfelt gratitude to you!

kostjaberdov
Автор

Bro, how about if the frontend are just mostly html and with little bit css?, i mean, its not using any framework. Im confused. Thanks!

liquidiz
Автор

I'm confused, the website was still running on 3000. Is that suppose to happen or shouldn't it be on the NGINX port 80?

prodbyeskay
Автор

please show me how to use it with env files or redirect requests

MrEmil-cfwo
Автор

what if my project is on windows please?

stevengrizy
join shbcf.ru