server { listen 80; index index.php; root /var/www/public; error_page 404 /index.php; location ~ ^/(images|javascript|js|css|flash|media|static)/ { root /var/www/public; } location ~ \.php$ { fastcgi_param REQUEST_METHOD $request_method; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\. { deny all; access_log off; log_not_found off; } location / { root /var/www/public; try_files $uri /index.php; } }