master_process on; worker_processes 4; # Ideally this should match the number of cores your server has! worker_cpu_affinity 0001 0010 0100 1000; worker_priority 0; worker_rlimit_nofile 8192; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { multi_accept off; worker_connections 1024; use kqueue; } http { include mime.types; default_type application/octet-stream; keepalive_timeout 0; ## General Options charset utf-8; source_charset utf-8; ignore_invalid_headers on; server_name_in_redirect off; ## TCP options tcp_nodelay off; tcp_nopush on; server { listen 80; server_name yourwebsite.com; root /usr/local/www/bindhub/yourwebsite; index index.php index.html index.htm; location / { try_files $uri $uri/ @handler; expires 30d; } location @handler { rewrite ^ /index.php?/$request_uri; } location ~ ^/index.php$ { fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param FUEL_ENV production; include fastcgi_params; } location ~ \.php$ { deny all; } location ~* ^/(modules|application|system) { return 403; } error_page 404 /index.php; # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } } }