Hy guys in the blog we gonna learn about the Magento virtual hosting setups in the previous blog we already set up some basic things like servers implementation on Nginx, MySQL, PHP
If you mess up that blog please check this below link that will more useful.
First, we gonna be creating some virtual domain addresses for Magento.
On your Linux machine go the /etc/hosts path
By using nano command edit the hosts file
sudo nano /etc/hosts
On that host file we gonna add some new
127.0.0.0 behindfacts.com
This behindfacts address it's the local virtual host for Magento.
Once the configuration is done on the host's file next we gonna configure the Nginx config file for Magento
sudo nano /etc/nginx/sites-available/behindfacts.com
Copy and past the full code on nano
upstream fastcgi_backend{
server unix:/run/php/php7.4-fpm.sock;
}
server {
listen 80;
server_name behindfacts.com;
set $MAGE_ROOT /var/www/html/magento;
include /var/www/html/magento/nginx.conf.sample;
}
Save the file in nano editor
sudo nginx -t
sudo systemctl reload Nginx
Refresh the behindfacts.com URL
It will directly be mapped towards the Magento directory