For some reason "out-of-the-box" the Wordpress JSON API does not work on Nginx. I have tried several redirect schemes in the nginx conf. The only thing I have gotten to work is ?json
. However, this does not work for authentication and registration.
As an FYI, I am developing a cordova application and attempting to use the WP JSON API for WP backend.
My Nginx conf for wp-json API.
location / {
# http://v2.wp-api.org/guide/problems/#query-parameters-are-ignored
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ ^/wp-json/ {
# if permalinks not enabled
rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
}