Start error: nginx: [emerg] https protocol requires SSL support
Issue
In the nginx.conf
file, if we use the following directive.
- Add the ssl configuration, for example:
server {
listen 443 ssl;
server_name test.com;
root /wwwroot;
ssl_certificate /wwwroot/test.com.pem;
ssl_certificate_key /wwwroot/test.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
}
- With reverse proxy. If the proxied server is a https server, for example:
location /some/path/ {
proxy_pass https://www.google.com;
}
When we start nginx, there may be an error as follow.
nginx: [emerg] https protocol requires SSL support in /opt/nginx-1.17.8/conf/server.conf:9
Solution
We can configure nginx again, and with --with-http_ssl_module
. To enable ngx_http_ssl_module.
$ ./configure --prefix=/opt/nginx-1.17.8 --with-http_ssl_module
$ make
$ sudo make install