Current location: home page > Website construction > Solve the problem that WordPress cannot log in to the background when configuring Baidu Cloud CDN

Solve the problem that WordPress cannot log in to the background when configuring Baidu Cloud CDN

Published on: March 22, 2020 Website construction 3 comments 23,608 views
This website provides Linux server operation and maintenance, automated script writing and other services. If you need, please contact the blogger on WeChat: xiaozme

background

The blog used to use Alibaba Cloud Singapore node, but the operator often blocked port 443, which made the website inaccessible. Just in time, Baidu Cloud was engaged in an activity, and bought a 500GB traffic package for 55 yuan, so it attached Baidu Cloud CDN (non Baidu Cloud Acceleration) to the blog to solve this problem. At first, the cache rules were set incorrectly, which led to WordPress background unable to log in. Record some precautions for WordPress to configure Baidu Cloud CDN.

Cache expiration time configuration

The background of WordPress is a dynamic page, so /wp-admin/ No cache is required, .php Such dynamic files do not need to be cached. Set the expiration time to 0 seconds , other cache expiration times are set according to their own conditions.

Turn off Ignore Parameters

Baidu Cloud CDN is enabled by default to ignore parameters, which will be ignored ? xxx= There are many problems with such parameters for dynamic programs like WordPress, so this function does not need to be enabled.

Turn off the back to source tracking 301/302

After enabling the source return 301/302, if the node source return request returns a 301/302 status code, it will directly jump to obtain resources and will not return 301/302 to the user

WordPress will dynamically create a 302 status code when logging in. If you enable the back to source follow 301/302, you will not be able to redirect normally, so you need to turn this function off.

Pay attention to the back to source protocol

If your source station is HTTP, you should select HTTP back to source. If the source station can be accessed through normal HTTPS, you should select HTTPS back to source. If the back to source protocol is selected incorrectly, it may lead to circular redirection. The origin of the Xiaoz blog deploys SSL, so here we choose HTTPS back to the source.

Note the forced HTTPS jump in HTTPS configuration

If your site has deployed an SSL certificate and redirected port 80 to 443, that is, the source site has set HTTP redirection to HTTPS, then it is unnecessary to set forced HTTPS redirection on the CDN, otherwise circular redirection will result.

last

Through the above settings, you can solve the problem that WordPress background cannot log in normally, and give reference to students who need it. In addition, if the CDN is set improperly, it will not accelerate, but will generate exceptions. Therefore, it needs to be configured reasonably according to its own business scenarios, otherwise it will backfire.


Post reply

Your email address will not be disclosed. Required items have been used * tagging


3 comments