Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am switching from Apache2 to nginx.

What is the equivalent of these commands in nginx world?

sudo a2enmod ssl
sudo a2enmod rewrite
sudo a2enmod headers 
sudo a2enmod expires 
sudo a2enmod php5

many thanks,

share|improve this question
up vote 2 down vote accepted

There's no equivalent, as Nginx modules are selected at compile time. The referenced Nginx docs will show the standard modules. Running nginx -V will show the compile options. For example:

$ nginx -V
nginx version: nginx/0.7.61
built by gcc 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
configure arguments: --prefix=/usr/local --sbin-path=/usr/local/sbin --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/ --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-http_flv_module --with-http_ssl_module --with-http_stub_status_module

As a side note, a2enmod is a Debian/Ubuntu-ism; other Linux distros will enable Apache modules in different ways.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.