Nginx - print all optional modules before compilation

./configure --help | grep -P "^ +--with-(?!(poll|select))[^=]+(_module( |$)| (module|support)$)" | sed -r 's/((dis|en)able|build) /# /'
wget http://nginx.org/download/nginx-1.15.3.tar.gz && tar -xzf 1.15.3.tar.gz && cd nginx-1.15.3
Sample Output
  --with-threads                     # thread pool support
  --with-file-aio                    # file AIO support
  --with-http_ssl_module             # ngx_http_ssl_module
  --with-http_v2_module              # ngx_http_v2_module
  --with-http_realip_module          # ngx_http_realip_module
  --with-http_addition_module        # ngx_http_addition_module
  --with-http_xslt_module            # ngx_http_xslt_module
  --with-http_image_filter_module    # ngx_http_image_filter_module
  --with-http_geoip_module           # ngx_http_geoip_module
  --with-http_sub_module             # ngx_http_sub_module
  --with-http_dav_module             # ngx_http_dav_module
  --with-http_flv_module             # ngx_http_flv_module
  --with-http_mp4_module             # ngx_http_mp4_module
  --with-http_gunzip_module          # ngx_http_gunzip_module
  --with-http_gzip_static_module     # ngx_http_gzip_static_module
  --with-http_auth_request_module    # ngx_http_auth_request_module
  --with-http_random_index_module    # ngx_http_random_index_module
  --with-http_secure_link_module     # ngx_http_secure_link_module
  --with-http_degradation_module     # ngx_http_degradation_module
  --with-http_slice_module           # ngx_http_slice_module
  --with-http_stub_status_module     # ngx_http_stub_status_module
  --with-http_perl_module            # ngx_http_perl_module
  --with-mail                        # POP3/IMAP4/SMTP proxy module
  --with-mail_ssl_module             # ngx_mail_ssl_module
  --with-stream                      # TCP/UDP proxy module
  --with-stream_ssl_module           # ngx_stream_ssl_module
  --with-stream_realip_module        # ngx_stream_realip_module
  --with-stream_geoip_module         # ngx_stream_geoip_module
  --with-stream_ssl_preread_module   # ngx_stream_ssl_preread_module
  --with-google_perftools_module     # ngx_google_perftools_module
  --with-cpp_test_module             # ngx_cpp_test_module
  --with-pcre-jit                    # PCRE with JIT compilation support


# if you want to see all removable modules just do
./configure --help | grep -P "^ +--without[^=]+(_module( |$)| (module|support)$)" | sed -r 's/((dis|en)able|build) /# /'

  --without-select_module            # select module
  --without-poll_module              # poll module
  --without-http_charset_module      # ngx_http_charset_module
  --without-http_gzip_module         # ngx_http_gzip_module
  --without-http_ssi_module          # ngx_http_ssi_module
  --without-http_userid_module       # ngx_http_userid_module
  --without-http_access_module       # ngx_http_access_module
  --without-http_auth_basic_module   # ngx_http_auth_basic_module
  --without-http_mirror_module       # ngx_http_mirror_module
  --without-http_autoindex_module    # ngx_http_autoindex_module
  --without-http_geo_module          # ngx_http_geo_module
  --without-http_map_module          # ngx_http_map_module
  --without-http_split_clients_module # ngx_http_split_clients_module
  --without-http_referer_module      # ngx_http_referer_module
  --without-http_rewrite_module      # ngx_http_rewrite_module
  --without-http_proxy_module        # ngx_http_proxy_module
  --without-http_fastcgi_module      # ngx_http_fastcgi_module
  --without-http_uwsgi_module        # ngx_http_uwsgi_module
  --without-http_scgi_module         # ngx_http_scgi_module
  --without-http_grpc_module         # ngx_http_grpc_module
  --without-http_memcached_module    # ngx_http_memcached_module
  --without-http_limit_conn_module   # ngx_http_limit_conn_module
  --without-http_limit_req_module    # ngx_http_limit_req_module
  --without-http_empty_gif_module    # ngx_http_empty_gif_module
  --without-http_browser_module      # ngx_http_browser_module
  --without-http_upstream_hash_module
  --without-http_upstream_ip_hash_module
  --without-http_upstream_least_conn_module
  --without-http_upstream_random_module
  --without-http_upstream_keepalive_module
  --without-http_upstream_zone_module
  --without-mail_pop3_module         # ngx_mail_pop3_module
  --without-mail_imap_module         # ngx_mail_imap_module
  --without-mail_smtp_module         # ngx_mail_smtp_module
  --without-stream_limit_conn_module # ngx_stream_limit_conn_module
  --without-stream_access_module     # ngx_stream_access_module
  --without-stream_geo_module        # ngx_stream_geo_module
  --without-stream_map_module        # ngx_stream_map_module
  --without-stream_split_clients_module
  --without-stream_return_module     # ngx_stream_return_module
  --without-stream_upstream_hash_module
  --without-stream_upstream_least_conn_module
  --without-stream_upstream_random_module
  --without-stream_upstream_zone_module

inspiration source:
https://gist.github.com/magnetikonline/6b66bbb3aade707d0a23

# notice: 
# i removed select and poll method because most kernels use kqueue
# and it will be built automaticly if kqueue is not supported

1
By: emphazer
2018-09-14 12:54:06

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: