美文网首页
nginx + php + https

nginx + php + https

作者: 请叫我小潘 | 来源:发表于2020-01-26 22:05 被阅读0次
server {
        listen 80;
        server_name   你的域名或IP;
        rewrite ^(.*)$  https://$host$1 permanent;
}

server {
        listen 443 ssl;
        server_name 你的域名或IP;
        root 站点文件路径;
        index index.php index.html;

        ssl_certificate   证书.pem文件路径;
        ssl_certificate_key  证书.key文件路径;

        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
}

相关文章

网友评论

      本文标题:nginx + php + https

      本文链接:https://www.haomeiwen.com/subject/viksthtx.html