nginx:[emerg]unknown directive "ssl"

nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:102

到解压的nginx目录下

./configure --with-http_ssl_module

当执行上面语句,出现./configure: error: SSL modules require the OpenSSL library.

用 yum -y install openssl openssl-devel

再执行./configure

重新执行./configure --with-http_ssl_module

make ,切记不能make install 会覆盖。

把原来nginx备份

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

把新的nginx覆盖旧的

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

出现错误时cp: cannot create regular file ‘/usr/local/nginx/sbin/nginx’: Text file busy

用cp -rfp objs/nginx /usr/local/nginx/sbin/nginx解决

测试nginx是否正确

/usr/local/nginx/sbin/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)

重启nginx

/usr/local/nginx/sbin/nginx -s reload

原文地址:https://www.cnblogs.com/valu/p/10527284.html

时间: 2024-10-10 09:28:03

nginx:[emerg]unknown directive "ssl"的相关文章

nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理

当我们在修改Nginx的配置文件,然后加载配置文件./nginx -s reload   报错类似的错误, nginx: [emerg] unknown directive “ ” in /usr/local/nginx/nginx.conf.conf:xx报错处理 那么,大多数我们就是配置刚刚写的这句代码的时候,多打了个空格,细心找一下,重写下就ok了! 原文地址:https://www.cnblogs.com/arebirth/p/errornginx01.html

配置 nginx server 出现nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7

在配置nginx 虚拟机时,执行 sudo /usr/sbin/nginx -t 报下面的错误: nginx: [emerg] "root" directive is duplicate in /etc/nginx/server/blogs.conf:7 nginx: configuration file /etc/nginx/nginx.conf test failed 错误原因是:在配置文件时,访问路径设置了两个,重复配置webroot路径导致,去掉一个就可以了. server {

nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:57

/************************************************************************************************ * nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:57 * 说明: * VPS安装Ubuntu 16.04,调一下Nginx的PHP Server. * * 20

Nginx报错nginx: [emerg] unknown log format "main"

故障描述: 在添加Nginx的子配置文件后报错误nginx: [emerg] unknown log format "main" 无法重新加载,仔细查看配置没有语法错误经过调试才发现是定义log_format的时候写到HTTP模块最下面,导致子配置文件无法识别. 错误的写法   include /opt/app/nginx/conf/conf.d/*.conf;   log_format  main  '$remote_addr - $remote_user [$time_local]

阿里云centOS7.4 nginx: [emerg] "server" directive is not allowed here in /etc/nginx/vhost/xxxxxx.conf:2

里云centOS7.4配置多个站点遇到的问题nginx: [emerg] "server" directive is not allowed here in /etc/nginx/vhost/xxxxxx.conf:2这个错误好尴尬,费了几个小时去解决,小白呀没办法 先贴下/etc/nginx/nginx.conf的内容 worker_processes 1; events { worker_connections 1024; } http { include mime.types;

nginx检查报错:nginx: [emerg] "server" directive is not allowed here in

想检查一个配置文件是否正确,-c 指定之后发现有报错,如下: [[email protected]2:~# nginx -t -c /etc/nginx/conf.d/default.conf nginx: [emerg] "server" directive is not allowed here in /etc/nginx/conf.d/default.conf:1 nginx: configuration file /etc/nginx/conf.d/default.conf t

openresty下提示nginx:…unknown directive "content_by_lua_block"

照着文档(http://openresty.org/cn/getting-started.html)的提示写个openresty的helloworld,运行  nginx -p `pwd`/ -c conf/nginx.conf  时出现:…unknown directive "content_by_lua_block" ,有的博客说是安装的openresty的版本过低,但我寻思着我的是最新版,应该不是这个原因,后来看到这篇讨论:https://segmentfault.com/q/1

nginx: [emerg] "proxy_cache_path" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:43

1.它只能使用于http{  }部分,把proxy_cache_path放置于http部分即可解决此问题.注意图示的上下文

Nginx负载均衡、ssl原理、生成ssl密钥对、Nginx配置ssl

Nginx负载均衡 Nginx负载均衡即为当代理服务器将自定义的域名解析到多个指定IP时,通过upstream来保证用户可以通过代理服务器正常访问各个IP. 代理一台机器叫做代理,代理两台及两台服务器就能叫做负载均衡. 负载均衡配置 创建一个配置文件/usr/local/nginx/conf/vhost/load.con [[email protected] ~]# vim /usr/local/nginx/conf/vhost/load.conf upstream qq.com #借助upst