From c8d0e437435ce1d19c2ce53e94a70db4f0c4ef4b Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Tue, 12 Apr 2016 17:02:20 +0200 Subject: [PATCH] Configure owncloud vhost even more like upstream suggests. --- roles/owncloud/templates/vhost.j2 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/roles/owncloud/templates/vhost.j2 b/roles/owncloud/templates/vhost.j2 index bf230dd..723d2a6 100644 --- a/roles/owncloud/templates/vhost.j2 +++ b/roles/owncloud/templates/vhost.j2 @@ -48,6 +48,12 @@ server { rewrite ^/.well-known/carddav /remote.php/dav/ permanent; rewrite ^/.well-known/caldav /remote.php/dav/ permanent; + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + location ~ ^/(build|tests|config|lib|3rdparty|templates|data)/ { deny all; } @@ -72,4 +78,11 @@ server { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_intercept_errors on; } + + # Adding the cache control header for js and css files + location ~* \.(?:css|js)$ { + add_header Cache-Control "public, max-age=7200"; + # Don't log access to assets + access_log off; + } }