问题原文
原帖链接 · Anthony Kong · CC BY-SA 3.0
This is needed because I need to implement a load balancer in GCP for a word press instance.
GCP will only forward a request to the wordpress instance if it passes the health test.
Here is a typical of definition of a health check screen
It expects the 'request path' to return 200. Otherwise the target system is considered down.
However if I create a page in wordpress e.g. /index.php/newpage, it will always return 301.
While the wordpress site is up and running, it fails the health check.
Is there any way I can define a page in wordpress that will return 200? Hopefully it will not require additional plugin because I would like avoid maintaining extra plugin.
The last resort to me is to add a url to the php server that will return 200. However the status of this url may not 100% reflect the health of the wordpress site (which may go down due to mysql issue for example). If it is indeed the last resort, what is the best way to implement it? I am not proficient with php developement.
The version of wordpress is 4.6.2
社区高分解答
原帖链接 · Anson Goldade · CC BY-SA 4.0
For what it's worth, I had to set-up a WordPress site in a container and get a health check to succeed before I could even get traffic directed to it. The suggestions for the "front page" work only AFTER WordPress has been installed through the browser. Prior to that they return a 302 status code to /wp-admin/install.php. I noodled around in the container folders and decided on using /wp-includes/images/blank.gif as the health check path. This allowed the health check to succeed and traffic started routing to the container. From there I installed WordPress through the browser and was able to change the health check path back to /.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
