如题:nginx https配置已经成功加入模块http_ssl_module,但依然报错the "ssl" parameter requires ngx_http_ssl_module
第一:[root@localhost nginx-1.18.0]# nginx -V
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
第二:nginx配置:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
listen 443 ssl;
server_name www.www1.com;
ssl_certificate ssl/server.crt;
ssl_certificate_key ssl/server.key;
location / {
root html;
index index.html index.htm;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
}
}
第三:[root@localhost nginx-1.18.0]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
第四:端口已经开放443
访问https://www.www1.com/ 报错:cat logs/error.log 查看请求错误日志
2021/03/28 19:16:32 [notice] 31223#0: signal process started
2021/03/28 19:16:32 [emerg] 22151#0: the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:13
请大伙帮看看,谢谢
问题解决了,给大伙分享下:
第一步:查看端口监听情况
netstat -lntp
看到443端口并没有被nginx监听,因此采取以下办法问题得以解决:
第二步:查看nginx进程:
ps aux | grep nginx
得到主进程5423
第三步:杀掉nginx主进程:
kill -INT 进程号 即 kill -INT 5423
第四步:重新启动nginx
问题解决