最新消息:Kglan博客,DDOS防护,CC防护,Syn防护,系统架构,高级网络安全,海外无限防护系统,特征码系统,自定义cc策略防护

Nginx配置SSL报错 nginx: [emerg] unknown directive “ssl”

nginx admin 14浏览

Nginx配置SSL报错 nginx: [emerg] unknown directive “ssl”

出现如图所示错误,处理办法如下

1.去nginx解压目录下执行

./configure --with-http_ssl_module

Nginx配置SSL报错 nginx: [emerg] unknown directive “ssl”

2.如果报错 ./configure: error: SSL modules require the OpenSSL library.则执行

yum -y install openssl openssl-devel

./configure

./configure --with-http_ssl_module

3.执行 make(切记不能 make install 会覆盖安装目录)

4.将原来 nginx 备份

cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

5.将新的 nginx 覆盖旧安装目录

cp objs/nginx /usr/local/nginx/sbin/nginx

Nginx配置SSL报错 nginx: [emerg] unknown directive “ssl”

如果报错,执行 cp -rfp objs/nginx /usr/local/nginx/sbin/nginx

6.测试 nginx 是否正确

/usr/local/nginx/sbin/nginx -t

Nginx配置SSL报错 nginx: [emerg] unknown directive “ssl”

如图最后是测试成功的,之前遇到一个错误是我的SSL证书路径有错,修改后测试通过

           

转载请注明:Kglan » Nginx配置SSL报错 nginx: [emerg] unknown directive “ssl”