wordpress 下配置 ssl证书,

server {
listen ;
server_name demo.example.com;
ssl on;
root /data/;
ssl_certificate /cert/cert.pem;
ssl_certificate_key /cert/cert.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. TLSv1.;
ssl_prefer_server_ciphers on;
}

http访问的时候,/wp-content/下的资源一律为404:

后将配置修改为

server {
listen 443 ssl;
server_name demo.example.com;
root /data/;
ssl_certificate /cert/cert.pem;
ssl_certificate_key /cert/cert.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. TLSv1.;
ssl_prefer_server_ciphers on;
}

所有资源请求正常!

04-15 16:44