This happened with 3.4 as well, but now also in 3.5 after upgrading (using the Ubuntu repository)
We get this error in the log when trying to reload or restart nginx:
[warning]
nginx on manu.herkserver.com could not be restarted.
Changes might not be available until this has been done. (error: Reloading nginx configuration: nginx: [emerg]
unknown directive "etag" in
/var/aegir/config/includes/nginx_vhost_common.conf:78
nginx: configuration file /etc/nginx/nginx.conf test failed)
etag is used in the following two blocks in /var/aegir/config/includes/nginx_vhost_common.conf
location ^~ /cdn/farfuture/
location ~* files/advagg_(?:css|js)/
Commenting out the etag lines allows nginx to start.
We're using nginx version 1.2.1 on Debian 7.10 (Wheezy)
It looks like the etag directive was added in nginx 1.3.3
http://nginx.org/en/docs/http/ngx_http_core_module.html#etag
I'm unsure if we can upgrade to 1.3.3. on our current platform, but there seems no reason to have the etag directive there if it breaks an otherwise functional nginx configuration.
Comment | File | Size | Author |
---|---|---|---|
#17 | provision-nginx-has-etag-2738987-17-D7.patch | 7.85 KB | millenniumtree |
#11 | provision-nginx-has-etag-2738987-7-D7.patch | 7.85 KB | millenniumtree |
Comments
Comment #2
millenniumtreeComment #3
millenniumtreeHad this in the wrong Project.
Comment #4
memtkmcc CreditAttribution: memtkmcc commentedIt seems that the problem here is that one occurrence of the
etag
directive (in the/cdn/farfuture/
location) is not enclosed within the if/else check.It should look like this:
Comment #5
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedAttached patch should fix this.
Comment #6
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedComment #7
millenniumtreeWrapping it with the if would theoretically fix it, except nginx_is_modern is TRUE for versions 1.1.8+, and etag is only supported in 1.3.3+
Every time I've run an aegir upgrade, I have had to comment out TWO instances of the etag (including the 2nd one that is already if'ed)
I think another property (nginx_has_etag) should be added to provision/http/Provision/Service/http/nginx.php for nginx 1.3.3+ and used in the vhost templates instead of nginx_is_modern.
Comment #8
millenniumtreeHere's a new regex that should match anything 1.3.3 or above.
nginx\/1\.([12][0-9]|[3]\.([12][0-9]|[3-9]))
Comment #9
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedHmm.. This gets a bit complicated, because we can't modify the regex for
$nginx_is_modern
since it is mainly related tolimit_zone
deprecated in Nginx 1.1.8, and replaced bylimit_conn_zone
.I don't like the idea of introducing more versions checks and more properties to accommodate old Debian releases. After all, Jessie comes with Nginx 1.6.2 and is a current Debian stable for over a year (since April 26th, 2015).
Also, you can always get rid of all those config issues by disabling the "extended" config, if it breaks things for you. Just
`touch /etc/nginx/basic_nginx.conf`
and re-verify the server.Comment #10
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedAt any rate, my patch doesn't fix the problem here.
Comment #11
millenniumtreeSo nginx 1.6.2 is supported...
$nginx_is_modern is there specifically to support nginx before 1.1.8...
But versions between 1.1.8 and 1.3.3 will fail due to the etag lines...
Because that makes little sense to me, I made this patch to fix it. :)
Comment #12
millenniumtreeComment #13
millenniumtreeOne of the hunks failed on 7.x-3.6, but applies on the current git 7.x-3.x. Had to manually apply it in 3.6 (but that may have been from your previous patch being applied...)
Successfully tested on the following two platforms, both with provision 7.x-3.6:
Ubuntu 14.04.4 LTS with nginx 1.4.6
Debian 7.6 "wheezy" with nginx 1.2.1
Comment #14
memtkmcc CreditAttribution: memtkmcc commentedLooks good to me, thanks!
Comment #15
memtkmcc CreditAttribution: memtkmcc commentedComment #16
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedThe patch from #11 fails to apply to the current 7.x-3.x :(
Comment #17
millenniumtreeRe-rolled patch for latest 3.x
Comment #18
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedCommitted, as it was rtbc already.
Comment #19
helmo CreditAttribution: helmo at Initfour websolutions for Aegir Cooperative commentedHmm, commit notification is not showing up here ... but it's in... http://cgit.drupalcode.org/provision/commit/?id=fd9aca8