Nginx on Windows Server: install, test and run it as a service
Unpack Nginx on Windows, test the config from the right directory, run it on 8081, and wrap it as a service without pretending it is Linux Nginx.
- Build
- 26100.33650
- Edition
- Standard / Datacenter
- Architecture
- x64
- Support
- Documentation (E1)
- Evidence
- E1Official documentation
- Verified
- 2026-10-29
- Test machine
- Nginx 1.28.0 on VM 361 Windows 11 26H2, port 8081; Server 2025 service wrapping E1
- Page type
- Setup

C:\nginx, default page on http://localhost:8081. Windows 11 UI; Server 2025 service setup is E1.The short answer
Section titled “The short answer”Nginx on Windows is a console application, not a Windows service by default:
cd C:\nginxnginx.exe -tstart nginxnginx.exe -s reloadnginx.exe -s stopThe official Windows build is useful for a lab, an internal site or a compatibility tier. It is not feature-equivalent to Linux Nginx: no php-fpm, no HTTP/3 module, and fewer tuning options. Do not present it as a high-concurrency production edge.
Install
Section titled “Install”- Download the Windows zip from nginx.org.
- Extract to
C:\nginx(avoidProgram Filesspaces and ACL surprises). - Edit
conf/nginx.conf; start withlisten 8081;if IIS already owns 80. - Run
nginx -tfromC:\nginx, thenstart nginx. - Open the firewall only for the lab network.
The lab used:
C:\nginx\nginx.exe -v -> nginx/1.28.0listen 8081http://localhost:8081/ -> 200 "Welcome to nginx!"Why nginx -t fails from the wrong directory
Section titled “Why nginx -t fails from the wrong directory”Nginx resolves conf/nginx.conf, logs/error.log and relative root paths against its working directory. Running it from C:\Windows\System32 produces:
CreateFile() "C:\WINDOWS\system32/conf/nginx.conf" failedThat is not a broken install. cd C:\nginx first, or use absolute paths in the config/service wrapper.
Run as a service
Section titled “Run as a service”Use a wrapper such as WinSW or NSSM. Minimal WinSW intent:
- executable:
C:\nginx\nginx.exe - working directory:
C:\nginx - stop:
nginx.exe -s stop(or wrapper’s stop command) - account: a dedicated low-privilege account with read on
C:\nginx, write onlogsandtemp - startup: automatic, restart on failure
Do not run it as LocalSystem just because the service starts. Nginx only needs its own directories.
Windows boundaries
Section titled “Windows boundaries”| Topic | Windows Nginx |
|---|---|
| php-fpm | Not available; use PHP-CGI/FastCGI |
| HTTP/3 | ngx_http_v3_module cannot be built on Win32 |
| Performance | Not Linux-equivalent; test before claiming numbers |
| Service | Wrapper required |
| Signals | nginx -s reload/stop, not Unix signals |
Verify
Section titled “Verify”cd C:\nginx.\nginx.exe -tGet-Process nginxInvoke-WebRequest http://localhost:8081/ -UseBasicParsing | Select-Object StatusCodeGet-Content .\logs\error.log -Tail 20Lab boundary
Section titled “Lab boundary”Nginx 1.28.0 was unpacked and served on 8081 on Windows 11 26H2. Server 2025 role/firewall/service wrapping remains E1; no performance or HTTP/3 claim is made.