Create NGINX Virtual Host with PHP 7.0

Here I have shared a script for creating NGINX virtual host with PHP 7.0. NGINX virtual host with  5.x and 7.0 is very similar but only different is php5-fpm.sock location. To create a NGINX virtual host open the configuration files by running this command.

sudo gedit /etc/nginx/sites-available/default

And then copy-pastes this code snippet and modify it by your configuration (information). Then restart your server. And you are ready to go.

See it for creating virtual host with PHP 5.x

Create Virtual Host in Nginx Server

To create a virtual host in Nginx server and access that by your browser you have to follow couple of steps. In this tutorial I will try to describe how you can create virtual host and how you can access your file by brower.

First STEP: Open your nginx configuration file by running this command.

sudo gedit /etc/nginx/sites-available/default

Second STEP: Then configure you host by following this

Third STEP: Open your hosts file.

sudo gedit /etc/hosts

And write ‘127.0.1.1  app.example.dev’  anywhere of your hosts file. Finally restart your nginx server and browser ‘app.example.dev’ in your browser. That’s it, hope it will work for you

See it for creating virtual host with PHP 7.0