码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-10-04 11:38:07      阅读:452      评论:0      收藏:0      [点我收藏+]

标签:bsp   efi   应该   原因   hub   安装   https   exe   htm   

照着文档(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/1010000019781462/,感觉有点方向了,又在github上看到:https://github.com/openresty/lua-nginx-module/issues/1554一段这样的话:

Seems like youre not invoking openrestys nignx. 
You may have multiple nginx executables in your system.
Try invoking openrestys nginx binary explicitly via its full path instead of relying on changing PATH environment variable values.

猜测原因是自己使用的nginx不是openresty中的自带的nginx。

后来猛地想起,自己在执行 ./configure的时候貌似忽略了一些参数。。。

官方给出的参考参数如下:(忘了自己当时少添加了哪个(或者是根本没有加参数))

./configure --prefix=/opt/openresty             --with-luajit             --without-http_redis2_module             --with-http_iconv_module             --with-http_postgres_module

于是重新执行编译一次openresty,这次将上面的后四个参数全加上去,再按照之前的步骤来,执行成功!

稍作记录,如果你遇到相同的问题,希望可以帮到你!

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

标签:bsp   efi   应该   原因   hub   安装   https   exe   htm   

原文地址:https://www.cnblogs.com/Guhongying/p/11621605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!