diff --git a/component/varnish/resources/varnish/kodekit.vcl b/component/varnish/resources/varnish/kodekit.vcl index 0b34c1df7..ae1116bbd 100644 --- a/component/varnish/resources/varnish/kodekit.vcl +++ b/component/varnish/resources/varnish/kodekit.vcl @@ -9,9 +9,9 @@ probe health #.url = "/varnish-enabled"; # We prefer to only do a HEAD / .request = - "HEAD /varnish-enabled HTTP/1.1" - "Host: localhost" - "Connection: close"; + "HEAD / HTTP/1.1" + "Host: localhost:%1$s" + "Connection: close" "User-Agent: Varnish Health Probe"; .interval = 5s; # check the health of each backend every 5 seconds .timeout = 1s; # timing out after 1 second. @@ -24,7 +24,7 @@ probe health backend default { .host = "127.0.0.1"; # IP or Hostname of backend - .port = "8080"; # Port Apache or whatever is listening + .port = "%1$s"; # Port Apache or whatever is listening .max_connections = 300; # That's it .probe = health; .connect_timeout = 600s; # How long to wait before we receive a first byte from our backend? @@ -35,7 +35,7 @@ backend default backend passthrough { .host = "127.0.0.1"; # IP or Hostname of backend - .port = "8080"; # Port Apache or whatever is listening + .port = "%1$s"; # Port Apache or whatever is listening } acl localhost @@ -113,36 +113,19 @@ sub vcl_recv return (pass); } - # Specific Nooku Platform rules + # Specific Kodekit Platform rules # Do not cache /administrator if(req.url ~ "^/administrator") { return (pass); } - # Specific Nooku Server rules - - # Do not cache webgrind.nooku.dev - if (req.http.host == "webgrind.nooku.dev") { - return (pass); - } - - # Do not cache phpmyadmin.nooku.dev - if (req.http.host == "phpmyadmin.nooku.dev") { - return (pass); - } - - # Do not cache /apc and /phpinfo - if (req.url == "/apc" || req.url == "/phpinfo") { - return (pass); - } - # Generic URL manipulation, useful for all templates that follow # Remove the Google Analytics added parameters, useless for our backend if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") { - set req.url = regsuball(req.url, "&(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", ""); - set req.url = regsuball(req.url, "\?(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "?"); + set req.url = regsuball(req.url, "&(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%%25]+)", ""); + set req.url = regsuball(req.url, "\?(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%%25]+)", "?"); set req.url = regsub(req.url, "\?&", "?"); set req.url = regsub(req.url, "\?$", ""); } @@ -374,7 +357,7 @@ sub vcl_backend_response # Large static files are delivered directly to the end-user without waiting for Varnish to fully read the # file first. Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend # doesn't send a Content-Length header. Only enable it for large files - if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { + if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { unset beresp.http.Set-Cookie; diff --git a/install/nginx/nginx.conf b/install/nginx/nginx.conf index fbd8c2312..9a1418ea3 100644 --- a/install/nginx/nginx.conf +++ b/install/nginx/nginx.conf @@ -1,17 +1,17 @@ server { - listen 80; - server_name localhost; + listen *:%3$s; + server_name %1$s.test www.%1$s.test %1$s.dev www.%1$s.dev; - root /var/www/nooku-server/source; + root %2$s; - access_log /var/log/nginx/nooku-server.access.log; - error_log /var/log/nginx/nooku-server.error.log; + access_log /var/log/nginx/%1$s.access.log; + error_log /var/log/nginx/%1$s.error.log; location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } # turn sendfile feature on - senfile on; + sendfile on; # prevent hidden files (beginning with a period) from being served location ~ /\. { access_log off; log_not_found off; deny all; } @@ -45,11 +45,11 @@ server { # for security reasons the next line is highly encouraged try_files $uri =404; - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass %4$s; fastcgi_index index.php; - fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; }