Besides the http
and mail
modules, there are a number of other modules included in the NGINX distribution. These modules are not activated by default, but may be enabled by setting the appropriate configuration option:
--with-<module-name>_module
As you can see, these are all modules that build upon the http
module, providing extra functionality. Enabling the modules at compile time should not affect runtime performance at all. Using the modules later in the configuration is where performance may be impacted.
I would therefore recommend the following configure
options for a web accelerator/proxy:
$ ./configure --with-http_ssl_module --with-http_realip_module --with-http_geoip_module --with-http_stub_status_module --with-openssl=${BUILD_DIR}/openssl-1.0.1p
And the following for a web server:
$ ./configure --with-http_stub_status_module
The difference lies in where NGINX will be faced with clients. The web acceleration role takes care of terminating SSL requests as well as dealing with proxied clients and making decisions based on where a client came from. The web server role only needs to provide default file serving capability.
I would recommend always enabling the stub_status
module, as it provides a means of gathering metrics on how your NGINX is performing.
There are also a number of http
modules that are normally activated, but may be disabled by setting the appropriate configuration option --without-<module-name>_module
. If you have no use for these modules in your configuration, you can safely disable them.