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; + } }