NGINX

scoop and PHP are necessary

Here you will need to have NSSM, I give more details in PHP guide.

Install NGINX with scoop

PowerShell
scoop install nginx

Create nginx

And install a new service, here for NGINX

PowerShell
sudo nssm install nginx

You will have a window to create new service, set path with nginx.exe path.

For Path, get path of current nginx, in this example change USERNAME

Path
C:\Users\USERNAME\scoop\apps\nginx\current\nginx.exe
Service name
nginx

Save the new service and start it:

PowerShell
sudo nssm start nginx

In any browser, at http://localhost, you have to see NGINX welcome page.

Restart nginx

If you change some data, like with nginx.conf, you will need to restart Service.

PowerShell
sudo nssm restart nginx

Add a new VHost

Add a new VHost to nginx.conf: C:\Users\USERNAME\scoop\apps\nginx\current\conf\nginx.conf

  • Add server_names_hash_bucket_size 64; to http block (just once, not for each VHost)
  • If you want a VHost check example server block with server_name laravel.localhost;

nginx.conf

You have update nginx.conf, so you need to restart NGINX Service:

PowerShell
sudo nssm restart nginx

hosts

You will need to update hosts to have a new VHost, you will find it here: C:\Windows\System32\drivers\etc\hosts. Open it with any IDE and, at the end, add two lines for each VHost with same server_name of server block. In my example, the server_name is server_name app.laravel.test

C:\Windows\System32\drivers\etc\hosts
127.0.0.1       app.laravel.test
::1             app.laravel.test

To save it, you need to be admin, you can use Visual Studio Code if you have any problems.


In any browser, at http://app.laravel.test, you have to see the app (for some browser, you will need to restart it).