Summary – Install NGINX as a service on Windows.

| NGINX | Host Two Web Apps on Same Server Same Port Different Domain Name Using NGINX.

Two Steps:

  1. Download Nginx and NSSM.
  2. Use NSSM to install NGINX as  a service.

Procedure

Download NGINX and NSSM

  1. Download nginx from official download page which is  http://nginx.org/en/download.html     Example used In this documentation is nginx 1.14.0
  2. Extract the file contents to C:\ drive so the directory for nginx is C:\nginx-1.14.0
  3. Download and install NSSM from the official download page given below. https://nssm.cc/download    Example used In this documentation is nssm  version 2.2.4.
  4. Extract the file contents to C:\ drive so the directory for nssm is C:\nssm-2.24

Use NSSM to install NGINX as  a service 

  1. Cd to the nssm directory and install nginx as a service .
    cd C:\nssm-2.24\win64
  2. After successful install you would be greeted by nssm GUI, then On the application tab set path to
    C:\nginx-1.14.0 \nginx.exe
  3. Set startup directory to
    C:\nginx-1.14.0
  4. On the I/O tab type on the Input slow
    "start nginx"
  5. Optionally set in the output and error slots.
    C:\foobar\nginx\logs\service.out.log and C:\foobar\nginx\logs\service.err.log
  6. In services manager you will find the new service, start it and test it in browser.

Tadda done!!

TECH0003-2018.7.19-Host-Two-Webapps-on-Same-Server-Same-Port-Different-Domain-Name-Using-NGINX-0

TECH0003-2018.7.19-Host-Two-Webapps-on-Same-Server-Same-Port-Different-Domain-Name-Using-NGINX-0

if you like the tutorial please spread the word aand comment below if you have any questions.

Categories: Software