nginx:[emerg]Unknown Directive “SSL” in C:\nginx-1.26.3/conf/nginx.conf:44
1. Nginx:[emerg]unknown directive “SSL” in C:\nginx-1.26.3/conf/nginx.conf:44. as shown in Figure 1
2. Check whether nginx supports ssl, run the following command to check whether nginx contains ssl module:
PS C:\nginx-1.26.3> .\nginx -V
nginx version: nginx/1.26.3
built by cl 16.00.30319.01 for 80x86
built with OpenSSL 3.0.15 3 Sep 2024
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre2-10.39 --with-zlib=objs.msvc8/lib/zlib-1.3.1 --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-stream --with-stream_realip_module --with-stream_ssl_preread_module --with-openssl=objs.msvc8/lib/openssl-3.0.15 --with-openssl-opt='no-asm no-tests -D_WIN32_WINNT=0x0501' --with-http_ssl_module --with-mail_ssl_module --with-stream_ssl_module
PS C:\nginx-1.26.3>
3. Find –with-http_ssl_module in the output. It can be found, indicating that Nginx has enabled SSL support. as shown in Figure 2
4. After re-editing the nginx configuration file, re-execute the command: .\nginx -s reload, no more errors will be reported. as shown in Figure 3
server {
listen 443;
ssl on;
ssl_certificate localhost.pem;
ssl_certificate_key localhost-key.pem;
}
replace with:
server {
listen 443 ssl;
ssl_certificate localhost.pem;
ssl_certificate_key localhost-key.pem;
}
![nginx: [emerg] unknown directive "ssl" in C:\nginx-1.26.3/conf/nginx.conf:44](https://www.shuijingwanwq.com/wp-content/uploads/2025/03/1.jpg)

