Nginx配置https的wordpress站點,wp-content目錄下資源404解決方案


wordpress 下配置 ssl證書,

server {
        listen       443;
        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.1 TLSv1.2;
        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.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
}

所有資源請求正常!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM