server { server_name www.insready.com; root /srv/www/insready.com/public_html; ## <-- Your only path reference. access_log /srv/www/insready.com/logs/access.log; error_log /srv/www/insready.com/logs/error.log; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } # This matters if you use drush location = /backup { deny all; } # Very rarely should these ever be accessed outside of your lan location ~* \.(txt|log)$ { deny all; } location ~ \..*/.*\.php$ { return 403; } location / { # This is cool because no php is touched for static content try_files $uri @rewrite; } location @rewrite { # Some modules enforce no slash (/) at the end of the URL # Else this rewrite block wouldn't be needed (GlobalRedirect) rewrite ^/(.*)$ /index.php?q=$1; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_pass unix:/tmp/php-fpm.sock; fastcgi_cache microcache; fastcgi_cache_bypass $no_cache; fastcgi_no_cache $no_cache; # Set cache key to include identifying components fastcgi_cache_key $cache_uid@$host$request_uri; fastcgi_cache_valid 200 301 15s; fastcgi_cache_valid 302 1m; fastcgi_cache_valid 404 1s; fastcgi_cache_min_uses 1; fastcgi_cache_use_stale error timeout invalid_header updating http_500; fastcgi_ignore_headers Cache-Control Expires; fastcgi_pass_header Set-Cookie; fastcgi_pass_header Cookie; ## Add a cache miss/hit status header. add_header X-Micro-Cache $upstream_cache_status; ## To avoid any interaction with the cache control headers we expire ## everything on this location immediately. expires epoch; ## Cache locking mechanism for protecting the backend of too many ## simultaneous requests. fastcgi_cache_lock on; } # Catch image styles for D7. location ~ ^/sites/.*/files/styles/ { try_files $uri @rewrite; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } }