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;
	}
}

 

你可能感兴趣的:(wordpress)