Advertisement
AhmadShamli

My Nginx.conf

Jul 24th, 2012
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.24 KB | None | 0 0
  1. user www-data;
  2. worker_processes 2;
  3. pid /var/run/nginx.pid;
  4.  
  5. events {
  6.     worker_connections 1024;
  7.     # multi_accept on;
  8. }
  9.  
  10. http {
  11.  
  12.     ##add limit connection by IP...
  13.     limit_conn_zone  $binary_remote_addr  zone=limitC1:3m;
  14.     limit_conn_log_level notice;
  15.    
  16.     ##limit request by ip
  17.     limit_req_zone  $binary_remote_addr  zone=limitR1:3m   rate=20r/s;
  18.     limit_req_log_level notice;
  19.    
  20.     ##
  21.     # Basic Settings
  22.     ##
  23.    
  24.     sendfile on;
  25.     tcp_nopush on;
  26.     tcp_nodelay on;
  27.     keepalive_timeout 65;
  28.     types_hash_max_size 2048;
  29.     server_tokens off;
  30.     client_body_temp_path /var/lib/nginx/body 1 2;
  31.  
  32.     # server_names_hash_bucket_size 64;
  33.     # server_name_in_redirect off;
  34.  
  35.     include /etc/nginx/mime.types;
  36.     default_type application/octet-stream;
  37.  
  38.     ##
  39.     # Logging Settings
  40.     ##
  41.  
  42.     access_log /var/log/nginx/access.log;
  43.     error_log /var/log/nginx/error.log;
  44.  
  45.     ##
  46.     # Gzip Settings
  47.     ##
  48.  
  49.     gzip on;
  50.     gzip_disable "msie6";
  51.  
  52.     # gzip_vary on;
  53.     # gzip_proxied any;
  54.     # gzip_comp_level 6;
  55.      gzip_buffers 32 8k;
  56.     # gzip_http_version 1.1;
  57.      gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  58.  
  59.     ## Size Limits
  60.     client_body_buffer_size 128k;
  61.     client_header_buffer_size 64k;
  62.     client_max_body_size 10M;
  63.     large_client_header_buffers 1 1k;
  64.  
  65.     ##
  66.     # nginx-naxsi config
  67.     ##
  68.     # Uncomment it if you installed nginx-naxsi
  69.     ##
  70.  
  71.     #include /etc/nginx/naxsi_core.rules;
  72.  
  73.     ##
  74.     # nginx-passenger config
  75.     ##
  76.     # Uncomment it if you installed nginx-passenger
  77.     ##
  78.    
  79.     #passenger_root /usr;
  80.     #passenger_ruby /usr/bin/ruby;
  81.    
  82.     ##########
  83.     ##http://wordpress.org/extend/plugins/nginx-proxy-cache-integrator/installation/
  84.     proxy_cache_path  /var/lib/nginx/cache  levels=1:2   keys_zone=staticfilecache:50m  max_size=200m;
  85.     proxy_temp_path /var/lib/nginx/proxy;
  86.     proxy_connect_timeout 30;
  87.     proxy_read_timeout 120;
  88.     proxy_send_timeout 120;
  89.     #IMPORTANT - this sets the basic cache key that's used in the static file cache.
  90.     proxy_cache_key "$scheme://$host$request_uri";
  91.     #########
  92.     proxy_buffer_size   16k;
  93.     proxy_buffers       32   16k;
  94.     proxy_busy_buffers_size 64k;
  95.     #########
  96.     ##
  97.     # Virtual Host Configs
  98.     ##
  99.  
  100.     include /etc/nginx/conf.d/*.conf;
  101.     include /etc/nginx/sites-enabled/*;
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement