Setting up an NGINX web server on a windows machine


NGINX is a free and open-source server which is known to be very performant. NGINX is also very often used as load balancer and mail server with support to POP3 and IMAP protocols

NGINX vs Apache

NGINX uses by far less memory than Apache and can handle much more requests per second, however, NGINX is harder to install and configure than Apache and third party modules are hard to integrate. NGINX is also not very stable on Windows machines

In this tutorial we will installing NGINX on Windows and making some configuration to run a HTML file with an image

Download the latest version of NGINX for Windows on http://nginx.org and unzip it on the C drive of your computer (For this tutorial we be using NGINX 1.16.0)

Open a windows explorer and go to the NGINX installation directory and create two new folders /data/www and /data/images. Inside /data/www we will create a HMTL file with following content:

Now inside /data/images we will insert a new image hokkaido.jpg

In the next step we will have to configure the server to properly display our HTML file. Open the NGINX configuration file conf/nginx.conf and overwrite its contents with

Open a command line and then change to the NGINX installation directory to start the NGINX server:

C:>cd nginx

C:\nginx>start nginx

Open a browser and call http://localhost and you should see following site

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">