0

Problem

The latest in my series of nginx problems.

I'm trying to get Perusio's nginx config working with AdvAgg. However I get an error, 404 requests are not getting through to AdvAgg. Basically nginx is intercepting them.

The solution other people have mentioned is to comment out the following line in the AdvAgg blocks however this has no effect.

try_files $uri @drupal;

How could i solve this? Here's hoping someone has come across it before.

Extra Thinking & Tests

First here's the full error, I left out the printout of the nginx 404 page.

AdvAgg will issue a request for a file that does not exist inside of the AdvAgg directory.
If AdvAgg sends a 404, everything is ok; if something else sends a 404 then that means that AdvAgg will not be able to generate an aggregate if it is missing as something else is handling the 404 before AdvAgg has a chance to do it. 
If you are reading this, it means that something else is handling the 404 before AdvAgg can. 

Raw request info:

    stdClass Object

       (
          [request] => GET /sites/default/files/advagg_css/css__1385728578.css HTTP/1.0
          User-Agent: Drupal (+http://drupal.org/)
          Host: 192.168.1.95

So the two relevants chunks are in the drupal.conf file. This is called from the website/server config file in sites-available.

Basically the following chunk is included in the server block:

location / {

....

  ## Advanced Aggregation module CSS
  ## support. http://drupal.org/project/advagg.
  location ^~ /sites/default/files/advagg_css/ {
      location ~* /sites/default/files/advagg_css/css_[[:alnum:]]+\.css$ {
          access_log off;
          add_header Pragma '';
          add_header Cache-Control 'public, max-age=946080000';
          add_header Accept-Ranges '';
          #try_files $uri @drupal;
      }
  }

  ## Advanced Aggregation module JS
  ## support. http://drupal.org/project/advagg.
  location ^~ /sites/default/files/advagg_js/ {
      location ~* /sites/default/files/advagg_js/js_[\w|-]+.js$ {
         access_log off;
         add_header Pragma '';
         add_header Cache-Control 'public, max-age=946080000';
         add_header Accept-Ranges '';
         #try_files $uri @drupal;
      }
  }

  ....
  try_files $uri @drupal;
}

Test 1: I know it's hitting the right place, because if I comment out the inside and put in deny all; then all the CSS disappears.

Test 2: The try_files $uri @drupal not inside the AdvAgg blocks is to enable Clean URL's. Unfortunately AdvAgg needs clean URL's so I can't test if that's what breaking it.

Here is a full pastebin of my drupal.conf and mysite conf from sites-available.

2

I solved the problem on nginx perusio conf change _ to __ on these lines (78 & 90 )

you can see my comment here https://drupal.org/comment/8304443#comment-8304443

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.