server { listen 80; server_name dev.example dev.example.com; root /var/www/sites/public/dev.example/; index index.html index.htm index.php; access_log /var/log/nginx/example.com_access.log; error_log /var/log/nginx/example.com_error.log; charset utf-8; open_file_cache max=2000 inactive=20s; open_file_cache_valid 60s; open_file_cache_min_uses 3; open_file_cache_errors off; gzip on; gzip_comp_level 2; gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml; gzip_disable "MSIE [1-6]\."; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.(js|css|png|jpg|gif|swf|ico|svg|xml)$ { fastcgi_hide_header Set-Cookie; open_file_cache max=2000 inactive=14d; open_file_cache_errors off; open_file_cache_min_uses 3; open_file_cache_valid 1m; output_buffers 1 2m; expires 14d; access_log off; log_not_found off; } error_page 404 /404.html; location = /usr/share/nginx/error/404.html { root /usr/share/nginx/error/; } error_page 500 502 503 504 /50x.html; location = /usr/share/nginx/error/50x.html { root /usr/share/nginx/error/; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_intercept_errors on; } }