To run NGINX with WSL (Windows Subsystem for Linux), you’ll need to install WSL, set up an appropriate Linux distribution, install NGINX, and start the server. Here’s the step-by-step process:
- Open PowerShell as Administrator and enable WSL:
wsl --install
- Update the package list in your Linux distribution (assuming Ubuntu here):
sudo apt update
- Install NGINX:
sudo apt install nginx -y
- Verify Installation by checking the NGINX version:
nginx -v
- Enable Service
sudo systemctl enable nginx
- Check Service status
sudo systemctl status nginx
- Start the NGINX service:
sudo service nginx start
- To check if NGINX is running, use:
sudo service nginx status
http://localhost
- Stop NGINX:
sudo service nginx stop
- Restart NGINX:
sudo service nginx restart
- Reload NGINX (to apply changes without a full restart):
sudo service nginx reload