Should I submit a patch here or is it possible to merge this commit?
https://github.com/omega8cc/provision/commit/e308ba0238b9125da2472b96fbf...

Comments

omega8cc’s picture

Issue reported on g.d.o http://groups.drupal.org/node/104004

smoothify’s picture

The updated nginx_advanced_include.conf is working fine now - thanks.

However nginx_simple_include.conf is still not working.

    ###
    ### catch all unspecified requests
    ###
    location / {
        #try_files $uri $uri/ @cache;
        if (!-e $request_filename) {
          break;
        }
        error_page 404 = @cache;
    }

The code above doesn't seem to work with the root - if you uncomment the try_files and comment the rest then it does work.

I also have noticed another problem with the @cache declaration. When boost is working it isn't setting the headers correctly.

When using simple config the http headers are:

Server: nginx/0.8.49
Date: Thu, 04 Nov 2010 12:20:37 GMT
Content-Type: text/html
Last-Modified: Wed, 03 Nov 2010 23:41:57 GMT
Vary: Accept-Encoding
Content-Encoding: gzip

200 OK

and when using advanced they are correct:

Server: nginx/0.8.49
Date: Thu, 04 Nov 2010 12:22:48 GMT
Content-Type: text/html; charset=utf-8
Last-Modified: Thu, 04 Nov 2010 11:23:06 GMT
Vary: Accept-Encoding
Expires: Tue, 24 Jan 1984 08:00:00 GMT
Cache-Control: must-revalidate, post-check=0, pre-check=0
X-Header: Boost Citrus 1.9
Content-Encoding: gzip

200 OK

I'm guessing this is down to the rewrite rule interfering with the add_header command?

        add_header Expires "Tue, 24 Jan 1984 08:00:00 GMT";        
        add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
        add_header X-Header "Boost Citrus 1.9";               
        charset utf-8;
        #try_files /cache/normal/$host${uri}_$args.html @drupal;
        if (-f $document_root/cache/normal/$host${uri}_$args.html) {
          rewrite ^/(.*)$ /cache/normal/$host${uri}_$args.html last;
          break;
        }
        error_page 404 = @drupal;

Again, when you switch back to the try_files method, it works just fine. Is there a particular reason for using the different approach in the two files?

omega8cc’s picture

The "simple" config is to support some older versions of Nginx and is used in Provision by default. We used different Boost compatible configuration before try_files was introduced, and the "simple" config is just a backport of currently used with newer Nginx versions "advanced" config. I don't think we really should support some very old Nginx versions, but at least it should work with any non-Boost enabled site. I will try to rewrite this "simple" config to include there our previously working support for Boost, but I recommend to just use most recent Nginx version with "advanced" config.

smoothify’s picture

I will be using advanced configuration myself from now on, but i noticed the default in aegir is to use the "simple" config - is there a way to change that, or is it best just to use a symlink?

omega8cc’s picture

Well, we have some test for Nginx version in Provision, so it should do that for you automatically, but for some reason it still doesn't work as expected. Until it is finally fixed, we are using a workaround in Barracuda/Octopus with symlink to override it and use "advanced" config instead.

omega8cc’s picture

Version: » 6.x-1.x-dev
Status: Active » Fixed

This has been fixed really long time ago!

Status: Fixed » Closed (fixed)

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