Nginx的安装SSL基本教程

http://wiki.nginx.org/Modules#Standard_HTTP_modules 这里面带有所有基本的模块,及需要额外增加的模块

1.安装带有ssl模块的 nginx

 

  wget http://nginx.org/download/nginx-0.8.52.tar.gz
  tar zxvf nginx-0.8.52.tar.gz
  chown root:root nginx-0.8.52 -R
  apt-get install libpcre3 libpcre3-dev
  apt-get install openssl
  apt-get install libssl-dev
  ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module  --with-http_realip_module
  make
  make install


 2.配置nginx 配置文件

   ssl on;
   ssl_certificate /etc/nginx/nginx_pas/*.crt;
   ssl_certificate_key /etc/nginx/nginx_pas/*.key;



3. 配置nginx的conf ,所有都要求访问https
   

   location / {
                rewrite ^/(.*) https://*.com/$1 permanent ;
                #root   /var/www/nginx-default;
                #index  index.html index.htm;
   }


 

 

posted @ 2013-05-03 19:34  javawebsoa  Views(219)  Comments(0Edit  收藏  举报