E
E
evil0o2014-09-06 23:27:46
Drupal
evil0o, 2014-09-06 23:27:46

Nginx and drupal why can't some of the images open?

What I found out is the problem only with those images that are scaled by Drupal, while they are created only when they are requested. It turns out that Nginx requests them for direct images, but they are not.
That is, first Nginx must check for the presence of images, and if not, then request through the standard mechanism.
I don’t know how to do this, and I don’t understand Nginx well either. DDDD

Answer the question

In order to leave comments, you need to log in

4 answer(s)
C
Cool Admin, 2014-09-06
@ifaustrue

If nginx is configured in classic reverse proxy mode, then for a web server it is essentially a normal browser, only a fast one.
I think there are no pictures, because nginx is not patient and you need to give it time to think, something like this

proxy_send_timeout   90;
proxy_read_timeout   90;
proxy_buffer_size    4k;
proxy_buffers     16 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_connect_timeout 30s;

S
s1dney, 2014-09-07
@s1dney

if (! -f $request_filename) {
    ...
}

You could post the config better. And then you yourself answered your own question and what you need is not clear.

I
Igor, 2014-09-07
@merryjane

Describe the resizing process.
Here you should obviously have a mechanism that, in case the picture is not found, would rewrite it into a script that should resize with the transfer of certain parameters.
Most likely this can be implemented on try_files. But without a detailed description of what and where should be rewrote and with what parameters it is difficult to suggest something.

V
Vlad Zhivotnev, 2014-09-10
@inkvizitor68sl

location @fallback {
proxy_pass http://wheredetamapack;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
... .error_page
404 = @fallback;
}
In the case of dryupal, the 404th error for statics must be handled by Apache.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question