I have a Lifeboat managed VPS (Ubuntu Server 22.04), where I defined a static path to a Wordpress instance on that server. I noticed, that the Wordpress REST API seems to be disabled or not reachable, and I am not able to find out why.
https://mainwp.nwscloud.ch/wp-json should actually return some json, indicating the API is functionable, but it does not. I have not disabled the REST API myself.
Could it be, that Lifeboat is configuring nginx in a way that will not allow access to the REST API?
The Wordpress trap option is unchecked (off) in my settings. I am able to access a number of URLs which contain wp- on my site, except the one for testing the REST API (https://mainwp.nwscloud.ch/wp-json)
To be more precise: When I am logged in to the Wordpress site, then the REST API is responding. But it remains disabled for logged out users. I know that there is a Wordpress plugin which is doing exactly that, but I have not installed it.
So at the moment I am clueless and Iām still trying to exclude nginx configuration as a possible culprit.
Lifeboat help says:
Enable WordPress trap activates a special Fail2Ban configuration built to ban any address that requests a URL which contains wp- and fails with a HTTP Status other than 2xx or 3xx. The rule bans an attacking IP Address from using the HTTP/80 and HTTPS/443 ports for 10 hours.
For servers without WordPress installed, this increases security and reduces time wasted with bad actors who scan for commonly vulnerable website software. This trap is only for use on a server that does not have WordPress installed!
Wordpress installations come set up to handle some of the fun URL things through Apacheās .htaccess configuration system. To achieve the same thing in nginx the config needs to be written to have mod_rewrites that operate in the same way. Basically, Lifeboat probably needs a āmod_rewrite for Wordpressā option.
Over the years many people have emailed me about Wordpress support, but no one has ever said āhey this is broken for meā so Iāve never spent the time to look into it. What strikes me as odd is that the API URL works for you when logged in. Iām poking around Wordpress + nginx documentation now. I will have an update later.
I have added to Lifeboat the configuration necessary for WordPress (and the SEO friendly links).
Until an official release, you can download this Pre-Release Build 208. This build features āmod_rewrite for WordPressā on the Static Files Options tab. Enable this option for your WordPress install and both the API and pretty-links will function as expected. A silly side note: for now, it is indeed possible to activate both the mod_rewrite for WordPress and the WordPress Trap at the same timeā¦