参考资料:
给Nginx配置一个自签名的SSL证书:http://www.liaoxuefeng.com/article/0014189023237367e8d42829de24b6eaf893ca47df4fb5e000
Configuring HTTPS servers:http://nginx.org/en/docs/http/configuring_https_servers.html
Nginx虚拟机配置示例:
server {
listen 443 ssl;
server_name www.tool.me;
access_log /data/log/www.tool.me_nginx.log combined;
error_log /data/log/www.tool.me_nginx.log;
index index.html index.htm index.php;
root /data/www;
autoindex on;
#ssl on;
ssl_certificate /usr/local/openresty/nginx/ssl/www.lmg.com.crt;
ssl_certificate_key /usr/local/openresty/nginx/ssl/www.lmg.com.key;
location ~ .*\.(php|php5)?$
{
fastcgi_pass my_php;
fastcgi_index index.php;
fastcgi_param CI_ENV 'local';
include /usr/local/openresty/nginx/conf/fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
}
0 条评论。