Drupal 7 images problem

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by demon326 on October 27, 2012 at 8:38am

Okay, the problem is simple: images generated by drupal 7's image system in nodes won't show up and i'm getting pissed because it won't work, even with all the info here...

Setup:
Nginx(80)--->apache(8080)(php backend)

Image part in the vhost:

location @rewrite {
proxy_pass http://mydomain.tld:8080/index.php?q=$uri;
}



## Drupal 7 generated image handling, i.e., imagecache in core. See:
## https://drupal.org/node/371374.
location ~* /files/styles/ {
access_log off;
expires 30d;
try_files $uri @rewrite;
}

What ever i do, it just won't work.....

Comments

Probably

Posted by perusio on October 27, 2012 at 11:21am

you have a another location that is matching the request. Have you tried requesting the images file directly from the backend?

Unless you post all the config we can't go much further. Also a debug log can show you exactly what's going on: http://nginx.org/en/docs/debugging_log.html.

Got it fixed already.... I

Posted by demon326 on October 27, 2012 at 12:54pm

Got it fixed already....

I know the code is propbly not the best, but it works:

location ^~ /files/styles/ {
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ http://mydomain.tld:8080/1ドル last;
break;
}
}

(sorry, not posting real url, can't take change it gets indexed with the apache port)

Hi Perusio. I'm also having

Posted by phreestilr on December 18, 2012 at 11:48pm

Hi Perusio. I'm also having issues getting image styles to work with my nginx config (posted at http://groups.drupal.org/node/273378).

In the above, you mentioned trying to request the image files directly from the backend. How would you go about doing that?

Thanks!

Well

Posted by perusio on October 27, 2012 at 3:57pm

that's a really awful Nginx configuration :)

The break is bogus, since there's no other rewrite phase directive in this location.
There's nothing to break from.

If it works with this config it means that you've got another location that matches the filename and that makes imagecache non functional with the previous config I suspect.

Do not create images styles

Posted by jyr on February 21, 2013 at 7:10am

Hey,

When I try new content with a image, the image style is not created.I have 775 files permissions, clear cache, restarted nginx and php-fpm and I have the same config

location ~* files/styles {
access_log off;
expires 30d;
try_files $uri @rewrite;
}

location @rewrite {
rewrite ^ /index.php last;
}

Log nginx

"GET /sites/blog.com/files/styles/medium/public/field/image/likehome.jpeg

But, I dont have "field" directory in "/sites/blog.com/files/styles/medium/public/", just have "modules" directory.

In Report status I have "Su servidor no puede mostrar el progreso de subida de archivos. Para ello necesita que el servidor web Apache se esté ejecutando con mod_php."

I dont understand. Any tips?

Hello, try : Catch image

Posted by angeloo on February 21, 2013 at 7:22am

Hello,

try :

Catch image styles

location ^~ /sites/default/files/styles/ {
 if (!-e $request_filename) {
 rewrite ^/(.*)$ /index.php?q=1ドル last;
 break;
 }
}

this worked

Posted by jyr on February 21, 2013 at 9:03am

Hey Angelo,

This worked for me, just changes "location ~* files/styles" for "location ^~ /sites/blog.com/files/styles/"

Thanks a lot!!!

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /