本文介绍了当CDN Azure支持和Cloudflare缓存处于活动状态时,它将返回502 Bad Gateway Error.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Azure VM的IIS上运行Wordpress站点.我还在Azure上定义了一个CDN终结点.如果我正在WP Super Cache中激活 CDN支持,如果我仅将 Cloudflare用作DNS ,则一切正常.如果我同时激活DNS和 Cloudflare上的缓存,我开始出现 502错误的网关错误.如果我是禁用WP Super Cache中的CDN支持,但同时将DNS + Cache保留在Cloudflare中,一切运行完美.请注意,仅当我从 http到https, ,因为该站点在CDN和Cloudflare缓存均处于活动状态之前可以正常工作.

I am running a Wordpress site on IIS of an Azure VM. I defined also one CDN endpoint on Azure. If I am activating in WP Super Cache theCDN support everything works fine if I am using Cloudflare only as DNS. If I am activating both DNS andcache on Cloudflare, I am starting to get 502 Bad Gateway error. If I amdisabling the CDN support in WP Super Cache but keep both DNS+cache in Cloudflare, everything runs perfect. Please notice that this problem has started to occur only after I changed fromhttp to https, because before the site worked fine with both CDN and Cloudflare cache active.

例如,当CDN支持处于活动状态但没有Cloudflare缓存时,或者当CDN支持被禁用并且Cloudflare对于DNS和缓存均处于活动状态时,可以访问此图片:

For instance, this picture may be accessed when either CDN support is active but no Cloudflare cache, or when CDN support is disabled and Cloudflare is active for both DNS and cache:

https://cdn-pc.azureedge.net/wordpress/wp-content/uploads/2013/01/ceata-lui-pitigoi-1.jpg

https://cdn-pc.azureedge.net/wordpress/wp-content/uploads/2013/01/ceata-lui-pitigoi-1.jpg

两者均处于活动状态时,以上链接返回502 Bad Gateway.

In the moment that both are active, the above link returns 502 Bad Gateway.

推荐答案

此外,由于Cloudflare也在管理您的DNS,因此请确保对任何Azure自定义域名都禁用了HTTP代理选项.

Also, since Cloudflare is also managing your DNS, ensure the HTTP proxy option is disabled for any Azure custom domain names.

您可以使用上述配置为您的主域名启用Cloudflare HTTP代理选项.

You can leave the Cloudflare HTTP proxy option enabled for your primary domain name with the configuration above.


这篇关于当CDN Azure支持和Cloudflare缓存处于活动状态时,它将返回502 Bad Gateway Error.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 18:59