下面的前提是以阿里云为平台基础的 在阿里云配置好https的准备工作
1.将https证书文件上传至服务器nginx下一个目录 记录下访问的绝对路径 这里是放在 /usr/local/nginx/crt/
2.将下面的配置文件进行相应的修改 上传至服务器配置文件的vhost目录
server {
listen 80;
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/crt/*.pem;
ssl_certificate_key /usr/local/nginx/crt/*.key;
server_name baidu.com;
access_log /data/wwwlogs/naidu.com_nginx.log combined;
index index.html index.htm index.php;
root /data/wwwroot/default;
location ~ \.php {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
#set $path_info $2;
}
fastcgi_param SCRIP