I run wordpress on nginx + php-fpm in a subfolder abc
. I want to upload images into a NextgenGallery and the ajax-based uploader yields this:
POST 404 for http://example.com/abc/index.php/photocrati_ajax
Obviously the rewrite in the nginx.conf
does not work. Here are the relevant parts of it:
try_files $uri $uri/ /index.php?q=$request_uri;
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass php-fpm;
fastcgi_index index.php;
}
So, how to serve photocrati_ajax
via nginx and make the uploads work?
Worked for me. Otherwise
POST
requests were missing theaction
parameter, whyever.I was trying many configs and found answer:
….
PROFIT!
404 error with Nginx, wordpress, Nextgengallery
It is problem with permalinks, the above suggestion works with one addition you have to disable and then enable the permalinks.
1) Install Nginx-helper
2) disable permalinks and save.
3) enable permalinks and save.
Once you can upload photos with nextgen, Nginx-helper is no longer needed. You can disable and remove it.