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?

closed as off-topic by fuxia Aug 17 '14 at 15:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

try_files $uri $uri/ /index.php?q=$uri&$args;

Worked for me. Otherwise POST requests were missing the action parameter, whyever.


I was trying many configs and found answer:

  1. install plugin Nginx-helper (nginx in embedded search)
  2. enable permalink in settings (any)
  3. optionality configure nginx with this manual http://codex.wordpress.org/Nginx ....



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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.