wordpress https腾讯配置


server {
    listen       80;
    server_name  www.henanjiancai.com henanjiancai.com;
    rewrite ^(.*) https://$host$1 permanent;
}
server {

	listen 443;
	#listen [::]:443;

	server_name www.henanjiancai.com henanjiancai.com;

	root /var/www/wordpress;
	index index.html index.php;
	
	ssl on;
        ssl_certificate /var/www/ssl/1_www.henanjiancai.com_bundle.crt;
        ssl_certificate_key /var/www/ssl/2_www.henanjiancai.com.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置
        ssl_prefer_server_ciphers on;
	
	location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
       }

	location / {
		try_files $uri $uri/ /index.php?$args;
		#try_files $uri $uri/ =404;
	}
	
	location ~ \.php$ {
        	fastcgi_pass   unix:/var/run/php/php7.0-fpm.sock;
        	fastcgi_split_path_info ^(.+\.php)(/.*)$;
        	include fastcgi_params;
        	fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        	fastcgi_param  HTTPS              on;
        	fastcgi_param HTTP_X-Sendfile-Type X-Accel-Redirect;
        	#fastcgi_param HTTP_X-Accel-Mapping /udisk=/var/www/edusoho/app/data/udisk;
        	fastcgi_buffer_size 128k;
        	fastcgi_buffers 8 128k;
		include fastcgi.conf;
                fastcgi_intercept_errors on;
        }

        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
		gzip off;
        }
	# 禁止用户上传目录下所有.php文件的访问,提高安全性
    	location ~ ^/files/.*\.(php|php7.0)$ {
        	deny all;
    	}
	
	location ~ \.user\.ini$ {
		deny all;
	}
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值