Let's break down the process in detail:
When NGINX starts up, it looks for configuration files in the /etc/nginx/sites-enabled directory. By creating a symbolic link from the sites-available directory to the sites-enabled directory, you effectively enable the configuration file without duplicating it.
Here's a step-by-step explanation of creating the symbolic link:
-
Open a terminal or command prompt.
-
Use the following command to create the symbolic link:
sudo ln -s /etc/nginx/sites-available/my-react-app /etc/nginx/sites-enabled/lnis the command for creating links.-sspecifies that the link should be symbolic (symlink)./etc/nginx/sites-available/my-react-appis the path to the configuration file you created in Step 1./etc/nginx/sites-enabled/is the destination directory where the symlink will be created.
-
After running the command, the symbolic link will be created in the
sites-enableddirectory, pointing to the configuration file in thesites-availabledirectory.
Creating this symbolic link allows NGINX to recognize and include the configuration file when it starts up or reloads its configuration. It's a way of enabling the configuration without modifying the main NGINX configuration file directly.
Once the symlink is created, you can proceed with testing the NGINX configuration and restarting NGINX to apply the changes.