Nginx配置https代理,一直报错 nginx: [emerg] https protocol requires SSL support in /usr/local/nginx/conf/nginx.conf:46

Nginx_configure.png

这个主要原生是因为nginx没有安装ssl模块

执行步骤

[root@120 ~]# cd /usr/local/src/nginx-1.6.1
[root@120 nginx-1.16.1]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
configure arguments: --prefix=/usr/local/nginx
[root@120 nginx-1.16.1]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module
[root@120 nginx-1.16.1]# make

[root@120 nginx-1.16.1]# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
[root@120 nginx-1.16.1]# cp ./objs/nginx /usr/local/nginx/sbin/
cp:是否覆盖"/usr/local/nginx/sbin/nginx"? y

如果提示:cp: 无法创建普通文件"/usr/local/nginx/sbin/nginx": 文本文件忙
先把nginx停止
[root@120 nginx-1.16.1]# /usr/local/nginx/sbin/nginx -s quit
然后启动
[root@120 nginx-1.16.1]# /usr/local/nginx/sbin/nginx




./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

标签: none

添加新评论