Skip to content

NGINX Web Server windows installation

SunilOS edited this page Mar 5, 2023 · 4 revisions

NGINX Web Server

Windows installation

  1. Download the latest stable version of Nginx from the official website https://nginx.org/en/download.html. Choose the Windows version and download the zip file.
  2. Extract the contents of the zip file to a directory on your system, for example, C:\nginx.
  3. Open a Command Prompt window as an administrator.
  4. Navigate to the Nginx directory using the command: cd C:\nginx
  5. Run the command: nginx.exe to start Nginx.
  6. Open a web browser and navigate to http://localhost. If Nginx is running correctly, you will see the Nginx welcome page.
  7. To stop Nginx, open a Command Prompt window as an administrator and navigate to the Nginx directory. Run the command: nginx.exe -s stop That's it! You have successfully installed Nginx on Windows. You can now use it as a web server or a reverse proxy.

Start/ Stop NGINX Server

nginx/Windows runs as a standard console application (not a service), and it can be managed using the following commands:

  • start nginx | start a server
  • nginx -s stop | fast shutdown
  • nginx -s quit | graceful shutdown
  • nginx -s reload | changing configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processes
  • nginx -s reopen | re-opening log files

See more

NGINX redirect server/port

In Nginx, you can redirect traffic from one port to another port using the proxy_pass directive in your configuration file /conf/nginx.conf. The proxy_pass directive tells Nginx to forward requests to another server or port.

Here's an example of how to redirect traffic from port 80 to 9095 and 9097 ports:

server {

`listen       80;`
`server_name  localhost;`

`location /SSOAPI {`
	`proxy_pass http://localhost:9095/NCSSSO;`
`}`

`location /DOCAPI {`
	`proxy_pass http://localhost:9097/NCSDOCS;`
`}`

}

Clone this wiki locally