nginx+ssl+php-fpm 配置

@fright  December 11, 2017

server {

listen 443 ssl;
ssl_certificate 证书;
ssl_certificate_key 私钥;
keepalive_timeout   70;
server_name     域名;
index           index.html index.htm index.php;
root            目录地址;
access_log      日志  main;
server_tokens off;
fastcgi_param   HTTPS               on;
fastcgi_param   HTTP_SCHEME         https;
 location /
{
    if (!-e $request_filename){ rewrite (.*) /index.php last;}
}

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

location ~ /\.ht
{
    deny  all;
}

}


评论已关闭