自用的 Nginx 编译命令

./configure --user=nginx --group=nginx \
    --with-http_v2_module --with-http_ssl_module \
    --with-stream --with-stream_ssl_module --with-http_sub_module \
    --with-http_realip_module --with-stream_realip_module \
    --with-pcre=<PATH> --with-zlib=<PATH> --with-openssl=<PATH>
  1. with-http_v2_module:支持 HTTP2

  2. with-http_ssl_module:支持 HTTP SSL,即 HTTPS

  3. with-stream:支持四层负载

  4. with-stream_ssl_module:支持四层配置证书

  5. with-http_sub_module:网页文本、XML 内容替换

  6. with-http_realip_module:HTTP 级别记录真实 IP,例如不记录 CDN,反代 IP

  7. with-stream_realip_module:Stream 级别记录真实 IP

  8. with-pcre:Rewrite 需要

  9. with-zlib:Gzip 需要

  10. with-openssl:SSL 需要

Last updated

Was this helpful?