Nginx config for NGG / NextGen Gallery

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:

Read More
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?

Related posts

3 comments

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

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

  2. 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.

Comments are closed.