nginx搭建https环境

【nginx搭建https环境】1、首先nginx必须支持ssl模块
./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module

2、配置server
server {

listen 443;
ssl on;
ssl_certificate /usr/local/cert/test.chained.crt;
ssl_certificate_key /usr/local/cert/test.seyouhui.cn.key;
server_name test.seyouhui.cn;
location / {
root /data/test;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php$ {
roothtml;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME /data/test$fastcgi_script_name;
includefastcgi_params;
}
}

    推荐阅读