Hello, guys!

Does anybody use ImageCache with Nginx only, without Apache as backend? Just pure Nginx+FastCGI, I mean. Any config suitable for Apache+Nginx does not working too, imagecache simply refuses to process images.

If someone can suggest any working solution for nginx vhost config file, it would be great, cause googling gave nothing for me.

Thanks!

Comments

steinmb’s picture

Hi
What does not work? After enabling the module, and creating a Imagecache preset, does the "files/imagecache/preset-name" get created?

Also try disabling clean URL in your Drupal installation. I have not any magic solution for you that fix your problem since I'll never used any other webservers then Apache on my servers.

lordofwinds’s picture

I have some problems on my sites. Hosting company use nginx and imagecache don't create folders and copy of images

steinmb’s picture

Have never used Nginx but here is some pointers.

Apache need mod_rewrite to work and you get exactly these problems if you insert this into your "/sites/default/files/.htaccess" file:

<IfModule mod_rewrite.c>
  RewriteEngine off
</IfModule>

Lighthttpd pls take a look at http://nordisch.org/2007/2/6/drupal-on-lighttpd-with-clean-urls

I think the problem is related to this. When you config your presets you will get no error messages right? and imagecache create the presets but not the directory structure?

Cheers
Stein

tanc’s picture

Igor, I was also having this problem but resolved it with the following in my nginx virtual host file:

        location ^~ /sites/default/files/imagecache/ {
            index  index.php index.html;

            if (!-e $request_filename) {
                rewrite  ^/(.*)$  /index.php?q=$1  last;
                break;
            }
        }

The above assumes that your imagecache files are to be stored in sites/default/files/imagecache
Instead of nginx serving the static content (the jpeg or png or whatever) to the browser it will instead rewrite the path to (invisibly): index.php?q=sites/default/files...
This allows imagecache to run its manipulations on the file.
Just make sure you alter the location directive to match whatever path your imagecache files are in (relative to site root) and you should be fine.

mrfelton’s picture

I have exactly the same in my nginx and it works for me too.

EDanee’s picture

This solved the problem for me too.
Thanks!

drewish’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed
tms8707056’s picture

This didn't work 100% for me. See post here (http://drupal.org/node/442350). Any ideas what to do?

Status: Fixed » Closed (fixed)
Issue tags: -nginx

Automatically closed -- issue fixed for 2 weeks with no activity.