Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Some time ago I installed Nginx and Passenger on Debian lenny with...

sudo apt-get install nginx
sudo gem install passenger
sudo passenger-install-nginx-module

This is what I get when I do nginx -V

nginx version: nginx/0.7.61
built by gcc 4.3.2 (Debian 4.3.2-1.1) 
configure arguments: --prefix=/opt/nginx --with-pcre=/tmp/pcre-7.8 --add-module=/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/nginx

Now I want to add SSL support to Nginx, what's the best, simplest way to do it?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Use the HttpSSLModule for nginx? Should be build into the nginx package and you can setup using the config here http://wiki.nginx.org/HttpSslModule

  listen 443 default_server ssl;
  ssl_certificate      /usr/local/nginx/conf/cert.pem;
  ssl_certificate_key  /usr/local/nginx/conf/cert.key;

inside your server{} config block.

EDIT:

Using passenger-install-nginx-module will by default install nginx from source. To install the SSL module, you will need to download the source yourself. You can download the source yourself using wget -O - http://nginx.org/download/nginx-0.7.69.tar.gz | tar -zx -C /tmp/ to extract the source to /tmp/nginx-0.7.69. Then rerun sudo passenger-install-nginx-module. Select option 2 (advanced) to pass extra arguments to the configure script. When prompted, enter /tmp/nginx-0.7.69 as your source directory. You can keep /opt/nginx as the install directory. When prompted for extra arguments, enter --with-http_ssl_module. Confirm the configure line, then let it build and install.

share|improve this answer
    
No, the SSL module is not there. Trying to use the ssl directive results in unknown directive. Using nginx -V doesn't show the SSL module. –  Xavi Sep 10 '11 at 7:16
    
Odd, just looked up the package at packages.debian.org/lenny/nginx and it depends on libssl, so the SSL module should be there, can you post the results of your nginx -V? Also, since lenny is on 0.6.32 of nginx, you would have to remove the default_server ssl directive as that is just for >=0.7.14. Instead, set ssl on; in your server {} block. –  slillibri Sep 10 '11 at 7:52
    
Please, see the results of nginx -V in the (edited) original question. Actually Nginx is 0.7.61 . Maybe I updated Nginx, but I really don't remember. Anyway, the problem remains, SSL module is not installed. –  Xavi Sep 10 '11 at 8:16
    
Sorry, maybe my notes about how I installed Nginx in this server are wrong, as dpkg -l '*' | grep nginx doesn't show anything, and I guess that means that I didn't install the package, but I installed it from source. –  Xavi Sep 10 '11 at 8:35
    
Sorry, I wasn't paying attention. When you did sudo passenger-install-nginx-module, by default it will download a source version of nginx and compile it. You will need to redo this, but select option 2 (the advanced option) to pass the --with-http_ssl_module directive to nginx's configure script. For this you will need to download the source for nginx yourself from nginx.org/en/download.html. –  slillibri Sep 10 '11 at 8:36

Your Answer

 
discard

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.