Using the API on Nginx results in a 404 error on the API url.
Certain versions of Nginx handle rewrite rules slightly differently. To fix this, in your Nginx rewrite rules change this:
#location / {To this:
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?_page_url=$1 last;
}
#}
location / {After the above updates, ensure you reload Nginx so the changes are enabled.
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?_page_url=$1 last;
}
}
rewrite ^/api/v2/(.*)$ /api/v2/index.php?_page_url=$1 last;