gpt4 book ai didi

css - 可以吗? wordpress + nginx+ https 一页

转载 作者:太空宇宙 更新时间:2023-11-03 14:38:22 25 4
gpt4 key购买 nike

我正在尝试让由 nginx 在 win 2012 r2 上运行的 wordpress 网站在/cart/、/my-account/和/checkout/页面上使用 https,但所有资源都是通过 http 加载的,并提供混合导致页面没有 css 或 js 的内容警告。

我尝试将 wordpress 设置 -> 通用站点地址和 worpdress 地址从 http 更改为 https,但这也无济于事。现在整个网站都尝试加载 https(我不需要我也在谷歌和各种关于如何使用 ssl 设置 nginx 的教程中浏览了大量内容,但这些教程主要涵盖整个站点 ssl 或只是实际上不是 wordpress 的路径。

在我的开发环境中,我使用的是自签名 ssl,它似乎适用于非 wordpress 页面(只是普通的 html 文件)。当使用购买的 ssl 证书在生产服务器上进行测试时,它也能正常工作。

所以我的问题是 我可以将 wordpress+nginx 设置为使用 https 服务一个或几个页面,而将其余 wordpress 页面设置为 http(包括 css、js 和图像) ?

我设置了 2 个服务器 block ,每个用于 http 和 https。我还设置了 phpmyadmin 和 jwplayer 自托管 js 库服务器 block ,以便能够播放 wowza 流。该站点仅使用 http 即可顺利运行,目前没有任何问题。

我完整的 nginx 配置 https://pastebin.com/2ZzmDgDR

下面是来自 self-siged-ssl.conf 的代码

# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

ssl_certificate C:/nginx/ssl/server.crt;
ssl_certificate_key C:/nginx/ssl/server.key;


ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
# Disable preloading HSTS for now. You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

# ssl_dhparam C:/nginx/ssl/dhparam.pem;

最佳答案

混合使用 HTTP 和 HTTPS 是一种非常不常见的方法。这就是为什么 wordpress 配置不提供它 并且限制您使用 HTTP HTTPS 的原因。

如果您在 ssl 加密的网站上通过 HTTP 加载第三方源,请尝试将第三方源切换为 HTTPS。如果那不可能,请将源移动到您的网站空间以通过 HTTPS 加载它 - 关于页面速度,您应该始终考虑这一点。

是否有什么阻止您通过 HTTPS 加载资源?

关于css - 可以吗? wordpress + nginx+ https 一页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45631565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com