読者です 読者をやめる 読者になる 読者になる

Mac - homebrewでnginxを入れるときはnginx-fullを入れよう

mac

nginxではなくてnginx-fullを使う

homebrewではbrew install nginxとすることでnginxを入れることが出来ますが、
この標準Formulaはオプションが最低限のものしかありません。

/Users/kanno% brew options nginx
--with-debug
    Compile with support for debug log
--with-gunzip
    Compile with support for gunzip module
--with-passenger
    Compile with support for Phusion Passenger module
--with-spdy
    Compile with support for SPDY module
--with-webdav
    Compile with support for WebDAV module
--devel
    install development version 1.5.10
--HEAD
    install HEAD version

※オプション付きでインストールするにはbrew install nginx --with-spdyのようにします

本来nginxにはもっとたくさんのオプションがあります。
それらを使うためにはnginxではなくてnginx-fullというFomulaを利用します。

homebrew-nginx

インストールの仕方はREADME.mdに書いてある通りです。

brew tap marcqualie/nginx
brew install nginx-full

nginx-fullのオプションはこの通り。

/Users/kanno% brew options nginx-full
--with-accept-language-module
    Compile with support for Accept Language Module
--with-accesskey-module
    Compile with support for HTTP Access Key Module
--with-addition
    Compile with support for HTTP Addition module
--with-anti-ddos-module
    Compile with support for Anti-DDoS module
--with-array-var-module
    Compile with support for Array Var Module
--with-auth-digest-module
    Compile with support for Auth Digest Module
--with-auth-ldap-module
    Compile with support for Auth LDAP Module
--with-auth-pam-module
    Compile with support for Auth PAM Module
--with-auth-req
    Compile with support for HTTP Auth Request Module
--with-auto-keepalive-module
    Compile with support for Auto Disable KeepAlive module
--with-autols-module
    Compile with support for Flexible Auto Index module
--with-cache-purge-module
    Compile with support for Cache Purge Module
--with-captcha-module
    Compile with support for Captcha module
--with-consistent-hash-module
    Compile with support for Consistent Hash Upstream module
--with-counter-zone-module
    Compile with support for Realtime Counter Zone module
--with-ctpp2-module
    Compile with support for CT++ Module
--with-dav-ext-module
    Compile with support for HTTP WebDav Extended Module
--with-debug
    Compile with support for debug log
--with-degredation
    Compile with support for HTTP Degredation module
--with-echo-module
    Compile with support for Echo Module
--with-eval-module
    Compile with support for Eval Module
--with-extended-status-module
    Compile with support for Extended Status module
--with-fancyindex-module
    Compile with support for Fancy Index Module
--with-flv
    Compile with support for FLV module
--with-geoip
    Compile with support for GeoIP module
--with-google-perftools
    Compile with support for Google Performance tools module
--with-gunzip
    Compile with support for gunzip module
--with-gzip-static
    Compile with support for Gzip static module
--with-headers-more-module
    Compile with support for Headers More Module
--with-healthcheck-module
    Compile with support for Healthcheck Module
--with-http-flood-detector-module
    Compile with support for Var Flood-Threshold module
--with-http-remote-passwd-module
    Compile with support for Remote Basic Auth password module
--with-image-filter
    Compile with support for Image Filter module
--with-log-if-module
    Compile with support for Log-if Module
--with-lua-module
    Compile with support for LUA module
--with-mail
    Compile with support for Mail module
--with-mod-zip-module
    Compile with support for HTTP Zip Module
--with-mogilefs-module
    Compile with support for HTTP MogileFS Module
--with-mp4
    Compile with support for mp4 module
--with-mp4-h264-module
    Compile with support for HTTP MP4/H264 Module
--with-notice-module
    Compile with support for HTTP Notice Module
--with-pagespeed-module
    Compile with support for Pagespeed module
--with-passenger
    Build with passenger support
--with-pcre-jit
    Compile with support for JIT in PCRE
--with-perl
    Compile with support for Perl module
--with-php-session-module
    Compile with support for Parse PHP Sessions module
--with-random-index
    Compile with support for Random Index module
--with-realip
    Compile with support for real IP module
--with-realtime-req-module
    Compile with support for Realtime Request module
--with-redis2-module
    Compile with support for Redis2 Module
--with-secure-link
    Compile with support for secure link module
--with-set-misc-module
    Compile with support for Set Misc Module
--with-spdy
    Compile with support for SPDY module
--with-status
    Compile with support for stub status module
--with-sub
    Compile with support for HTTP Sub module
--with-subs-filter-module
    Compile with support for Substitutions Filter Module
--with-tcp-proxy-module
    Compile with support for TCP proxy
--with-txid-module
    Compile with support for Sortable Unique ID
--with-upload-module
    Compile with support for Upload module
--with-upload-progress-module
    Compile with support for Upload Progrress module
--with-upstream-hash-module
    Compile with support for Upstream Hash Module
--with-upstream-order-module
    Compile with support for Order Upstream module
--with-ustats-module
    Compile with support for Upstream Statistics (HAProxy style) module
--with-var-req-speed-module
    Compile with support for Var Request-Speed module
--with-webdav
    Compile with support for WebDAV module
--with-xslt
    Compile with support for XSLT module
--without-pool-nginx
    Disable nginx-pool, valgrind detect memory issues
--devel
    install development version 1.5.10
--HEAD
    install HEAD version

多い。

なぜ公式Formulaのnginxはオプションが少ないのか

「nginxのモジュール(オプション)は多すぎてメンテナンスが大変だから」

ということらしいです。
なので仮に本家にプルリクを送っても上記のnginx-fullを使ってくれと言われて却下されます。

nginx-fullはメンテナンスされているので、何かあればこちらにプルリクを送る方が良さそうです。

なお、オプションを別に使わなければどっち使っても変わらないはずです。