源码安装

  1. 下载源码
  1. wget https://openresty.org/download/openresty-1.15.8.3.tar.gz
  1. 解压缩
  1. tar -zxvf openresty-1.15.8.3.tar.gz
  2. cd openresty-1.15.8.3
  1. 编译安装
  1. sudo ./configure --prefix=/usr/local/openresty \
  2. --with-pcre-jit \
  3. --with-http_ssl_module \
  4. --with-http_realip_module \
  5. --with-http_stub_status_module \
  6. --with-http_v2_module \
  7. --with-cc-opt="-I/usr/local/opt/openssl/include/ -I/usr/local/opt/pcre/include/" \
  8. --with-ld-opt="-L/usr/local/opt/openssl/lib/ -L/usr/local/opt/pcre/lib/" \
  9. --with-openssl=/usr/local/opt/openssl/ \
  10. -j8
  11. sudo make
  12. sudo make install

如果出现[/usr/local/opt/openssl/.openssl/include/openssl/ssl.h] Error 127错误,可修改bundle/nginx-1.15.8/auto/lib/openssl/conf,去除.openssl目录,重新编译安装