Vikas Patel Feb,08 2017
I am setting up nginx in my development environment. I am using windows 10, Lucee with iis and nodejs with expressjs and iisnode. To replace IIS with nginx, first I downloaded nginx and extracted in
C:/nginx. Before we configure nginx, first let's configure Lucee. I had installed Lucee installer and running on 8888 port. Now add you website entry in engine tag as follow:
Now, create a
lucee.conf file and add in
C:/nginx/conf folder with following content.
Now, we'll configure nginx so open a file
C:/nginx/conf/nginx.conf. Now either remove the existing server block or adjust it according to following:
I am also adding another server block for my node application:
mynodeapp.conf file contents are as follow:
Okay, required configuration is now completed. Now, you may have IIS is your default http service which starts when your PC starts. We need to stop this to acquire 80 port. Open windows services, and stop World Wide Web Publishing Service. Also make this service manual so that it doesn't start when your PC starts.
Now, we need to create a service for nginx so that it can be automatically started when PC starts. Visit this stackoverflow page, it will guide you to create windows service wrapper for nginx.
All right, now check out this nginx for windows page, specially known issues and possible future enhancement. Open nginx.conf file and see that they have limited
worker_processes to 1. I tested my website with jMeter, and found that it gives poor performance than IIS. I increased it to 1024, and now it gives good performance than IIS.
I hope this post helps you. Let me if you find any issues with configuration. Now that the required configuration is completed, it's time to play with nginx to discover best tuning option that suits your web site.