Ask your Question

PEOPLE YOU MIGHT KNOW

Graves Injury
Graves Injury

Vero Beach, FL 32960,  United States
Gauri
Gauri

Student

Pune,  India
Khushi
Khushi

Varanasi,  India
The Dunes
The Dunes

East Hampton, NY 11937 ,  United States
Zhenya
Zhenya

Bansko,  Bulgaria

Write to us

Ask Question

Setup Virtual Host on Nginx for Magento

1. Create your project folder at path var/www/html

    cd /var/www/html

      mkdir magentodemo                // create project folder if you have not created any folder yet

 

2.Create a virtual host for your Magento store

    sudo nano /etc/nginx/sites-available/magentodemo.com

3. Add the below configuration in the host file

    upstream fastcgi_backend {

    server unix:/run/php/php7.1-fpm.sock;

   }

   server {

      error_log /var/log/nginx/magentodemo-error.log;

      listen 80;

      server_name localhost.magentodemo.com;

      set $MAGE_ROOT /var/www/html/magentodemo;

      include /var/www/html/magentodemo/nginx.conf.sample;

  }

 

Replace magentodemo.com with your domain name

 

4. Activate the newly created virtual host by creating a symlink to the /etc/nginx/sites-enabled directory

 

    ln -s /etc/nginx/sites-available/magentodemo.com /etc/nginx/sites-enabled/

5. Test the configuration

     nginx -t

 

6. Create an entry in your host file

     sudo nano /etc/hosts

     An entry like below in host file

    127.0.0.1 localhost.magentodemo.com

 

7. Hit the url on your browser

    http://localhost.magentodemo.com

It Should work !!

 

0   0
Pushpendra Singh

List Your Business

Improve Your Business Visibility

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site