阿里云ecs 服务器配置 nginx https

未结帖
0 665
ajian admin_jim 2017-01-11
悬赏:5飞吻
  1. 选择购买赛门铁克的免费 DV 证书。

    https://common-buy.aliyun.com/?commodityCode=cas#/buy
  2. 根据提示不全内容

    https://yundun.console.aliyun.com/?p=cas#/cas/home
  3. 下载证书 上传到服务器指定位置

  4. 配置nginx



server {
    listen       443;
    server_name  example.com;
    access_log   /var/log/xxx.log;
    root  /xxx/xxx/;
    ssl on;
    #证书在服务器的绝对位置
    ssl_certificate   /xxx/213996598310998.pem;
    #证书在服务器的绝对位置
    ssl_certificate_key  /xxx/213996598310998.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    
    	index index.html index.htm index.php;
	root /alidata/www/jimmyblog/wwwroot;
	location ~ .*\.(php|php5)?$
	{
		#fastcgi_pass  unix:/tmp/php-cgi.sock;
		fastcgi_pass  127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param HTTPS 'on';    #这一项一定要加上 否则PHP程序中的$_SERVER['HTTPS']为空
		include fastcgi.conf;
	}
    
    
}


热忱回答0


最近热帖

近期热议

  1. javascript——prototype与__proto 9
  2. Mysql 中出现的Data truncated for column 3
  3. 在nginx中使用x-sendfile的解决方案 3
  4. 高版本jQuery面插件实现Ajax上传图片 1
  5. Thinkphp Socket.class.php 类的使用 1
  6. 使用ionic3创建第一个App 0
  7. ios-oc html5 0
  8. nginx.conf 0
  9. 基于ionic3.4.0的项目搭建 0
  10. php 缩略图 0