Nginx的安装SSL基本教程

来源:互联网 发布:linux socket封装 编辑:程序博客网 时间:2024/06/07 12:19

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;   }


原创粉丝点击