In this guide, we want to teach you How To Install and Run Nginx on Windows Server 2022.
NGINX is open-source software for web servers, reverse proxying, caching, load balancing, and media streaming – and is widely used for its high-performance lightweight architecture.
How To Install and Run Nginx on Windows Server 2022
To install Nginx on your Windows Server, first, you need to go to the Download Versions of Nginx for Windows page and download the mainline version.
Then, you must extract the file into the Program Files folder with popular compression software.
Now you can start to install Nginx on Windows Server 2022.
How To Install Nginx on Windows Server
To install Nginx, open the Nginx file and double-click on the Nginx.exe file.
At this point, you can verify that your Nginx server is successfully installed on your Windows server. To do this, open your browser and type:
You will see the Welcome to Nginx page:
If you see this page means that your Nginx server is successfully installed on your server and it is working correctly.
Now follow the steps below to run Nginx on your Windows Server.
How To Run Nginx on Windows Server
We assumed that you have enabled IIS on Windows Server 2022. To do this, you can check our guide Set up and Configure IIS on Windows Server 2022.
Then, open the IIS manager directly from the start menu and run it as an administrator.
At this point, you can access the default website, which is usually located at “inetpub wwwroot.”
It is recommended to change the Physical path of this root. Create a new folder named “Work” in C:\. From your IIS manager on the default website right-click on it and click on the manage website and open advanced settings.
In the Advanced settings windows, from the Physical path open it and change the path to the work folder that you have made and press ok.
At this point, go to the Nginx folder and open the conf folder on Windows Server 2022. Right-click on the Nginx.conf file, and open the file with Notepad or another editor that you want.
In your Notepad, find the location of your root and change it to the Physical path that you have defined above.
At this point, save and close the file.
Now you can edit the index.html file and change the text. Open the Nginx HTML file on Windows Server 2022 and right-click on the index.html file and open it with Notepad.
When you are done, save and close the file.
Now exit the Nginx.exe program using “End Task.” Open and run the “nginx.exe” file in Admin mode.
Then, in your web browser type localhost, and you will see the hello world message.
At this point, you learn to Install and Run Nginx on Windows Server 2022.
Hope you enjoy it.