nginx -t error: [emerg] "default_type" directive is duplicate
<p>Had a copy+paste Nginx config for a server running multiple WP sites with super slow page loads. Ran and configured MSQL and Apache using Apachebuddy.pl</p>

<p>Nginx wouldn't restart due to the above errors and, after an inadvertent server restart, the following error is present: </p>

<blockquote>
  <p>Error: Unable to make action: Unable to manage service by nginxmng: ('start', 'nginx'). Error: [2016-03-22 22:14:01] ERR [util_exec]
  proc_close() failed ['/usr/local/psa/admin/bin/nginx_control'
  '--start'] with exit code [1]  Can not start proxy server:
  /usr/local/psa/admin/sbin/nginx-config execution failed: nginx:
  [emerg] "default_type" directive is duplicate in
  /etc/nginx/nginx.conf:32 nginx: configuration file
  /etc/nginx/nginx.conf test failed</p>
</blockquote>

<p>Here is erroneous nginx.conf</p>

<pre><code>#user nginx; worker_processes 1;
#error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log     notice; #error_log /var/log/nginx/error.log info;
#pid /var/run/nginx.pid; 
events { worker_connections 1024; } 
http { #include mime.types; default_type application/octet-stream;
 #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"';
 #access_log /var/log/nginx/access.log main;
 sendfile on; tcp_nopush on; types_hash_max_size 2048; server_names_hash_bucket_size 64; include /etc/nginx/mime.types; default_type application/octet-stream;
 keepalive_timeout 10;
 tcp_nodelay on; 
 gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 9; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
 #gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/*.custom 
 server_tokens off; 
 location ~* .(ico|jpg|webp|jpeg|gif|css|png|js|ico|bmp|zip|woff)$ { access_log off; log_not_found off; add_header Pragma public; add_header Cache-Control "public"; expires 14d;
 location ~* .(php|html)$ { access_log off; log_not_found off; add_header Pragma public; add_header Cache-Control "public"; expires 14d;
 fastcgi_cache_path /dev/shm/nginx levels=1:2 keys_zone=stupidfast:16m max_size=1024m inactive=60m;
 fastcgi_pass_header Set-Cookie; fastcgi_pass_header Cookie; fastcgi_ignore_headers Cache-Control Expires Set-Cookie; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+.php)(/.+)$;
 fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_intercept_errors on; include fastcgi_params; fastcgi_no_cache $no_cache; fastcgi_cache_bypass $no_cache; fastcgi_cache drm_custom_cache; fastcgi_cache_key $server_name|$request_uri; fastcgi_cache_valid 404 60m; fastcgi_cache_valid 200 60m; fastcgi_max_temp_file_size 4m; fastcgi_cache_use_stale updating;
 fastcgi_pass localhost:9000; { override global parameters e.g. worker_rlimit_nofile #include /etc/nginx/*global_params;
</code></pre>