Nginx配置SSL证书实现HTTPS访问

申请第三方权威认证机构(如CA,Symantec,GeoTrust,CFCA)签发的SSL数字证书,实现网站HTTPS访问

证书文件:

app.yezhou.cc.jks
app.yezhou.cc.key
app.yezhou.cc.pem
app.yezhou.cc.pfx

虚拟主机配置:

server {
    listen       80;
    listen       443 ssl;
    server_name  app.yezhou.cc;
    index index.html index.htm index.php;
    root /data/www/app;
    server_name_in_redirect off;

    location ~ .+\.php($|/)
    {
        #fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include       fastcgi.conf;

        fastcgi_split_path_info  ^(.+\.php)(/.*)$;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires 30d;
    }
    location ~ .*\.(js|css)?$
    {
        expires 1h;
    }
    #伪静态及日志
    #include /data/server/nginx/conf/rewrite/app.conf;
    error_log /data/www/logs/app-error.log;
    access_log /data/www/logs/app-access.log;

    ssl on;
    ssl_certificate /data/ssl/app/app.yezhou.cc.pem;
    ssl_certificate_key /data/ssl/app/app.yezhou.cc.key;
    ssl_session_timeout 5m;
}
上一篇 Nginx非80端口访问域名配置
下一篇 Nginx开启文件目录列表显示功能
目录
文章列表
1 MySQL慢查询
MySQL慢查询
2
GreenDao insert 解决 PRIMARY KEY must be unique
GreenDao insert 解决 PRIMARY KEY must be unique
3
使用 Docker 部署 Spring Boot
使用 Docker 部署 Spring Boot
4
Arthas(阿尔萨斯) -- 阿里在线诊断神器
Arthas(阿尔萨斯) -- 阿里在线诊断神器
5
Laravel中Validator的验证扩展
Laravel中Validator的验证扩展
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。