dunglas / frankenphp-wordpress

WordPress on FrankenPHP
122 stars 18 forks source link

Wordpress /wp-json malfunction #8

Open manzu opened 1 year ago

manzu commented 1 year ago

The Wordpress REST API under the uri path /wp-json doesn't work under FrankenPHP with the included Caddyfile. Because of this you can't use the Jetpack plugin and probably other things also. Another symptom of this is that Tools > Site Health reports problems.

Might be related to PHP 8.2 / Wordpress which is beta support still

Adding

               handle_path /wp-json/* {
                        uri strip_prefix /wp-json
                        rewrite index.php?rest_route={uri}
               }

to the Caddyfile helps in /wp-json/ now working but Site Health and Jetpack still fail

manzu commented 1 year ago

With this solution I think we may need to pass the Authorization header with a module like https://caddyserver.com/docs/modules/http.handlers.authp

manzu commented 1 year ago

disregard my last comment. the Cookie headers containing authorization are being sent.

also the handle_path directive is not needed

staudenmeir commented 10 months ago

@manzu Are you still having this issue? I can't reproduce it with the current version of this repository and WordPress 6.4.3.