Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Can someone explain the sequence of events when a request for non existent file: sites/default/files/styles/medium/public/french_toast.jpg

What I think happens is:

1.Matches 1st location and attempt to serve file, which fails and then is told to go to @rewrite location.

2.rewrite rule is matched and processing cycle restarts like a new request and location / is matched causing a proxy pass to be made to apache server and the file is served.

location ~ ^/sites/.*/files/styles/ 
{
    try_files $uri @rewrite;
}

location @rewrite 
{
    rewrite ^/(.*)$ /index.php?q=$1;
}

location / 
{
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://127.0.0.1:8080;
}
share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.