Advertisement
Guest User

Nginx Performance Bacon Configuration

a guest
Oct 23rd, 2013
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. # -----------------------------------------------------------------------------
  2. # Nginx configuration file
  3. # -----------------------------------------------------------------------------
  4. user www-data;
  5.  
  6. # must match your number of CPU cores
  7. worker_processes 6;
  8.  
  9. # max open files (but this reflects the amount already setup on our system)
  10. worker_rlimit_nofile 500000;
  11.  
  12. pid /var/run/nginx.pid;
  13.  
  14. events {
  15. # concurrent clients served by worker
  16. # tried other values from 1024 to 32768 without better results
  17. worker_connections 4096;
  18.  
  19. # accept() as many connections as possible
  20. multi_accept on;
  21.  
  22. # in case that's not the default policy under Linux...
  23. use epoll;
  24. }
  25.  
  26. http {
  27. charset utf-8; # HTTP "Content-Type:" header
  28. sendfile on;
  29. tcp_nopush on;
  30. tcp_nodelay on;
  31. keepalive_timeout 10;
  32. keepalive_requests 10; # 1000+ slows-down nginx enormously...
  33.  
  34. types_hash_max_size 2048;
  35. include /usr/local/nginx/conf/mime.types;
  36. default_type application/octet-stream;
  37.  
  38. gzip on;
  39. gzip_min_length 500;
  40.  
  41. gzip_vary on; # HTTP "Vary: Accept-Encoding" header
  42. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  43.  
  44. server {
  45. listen 127.0.0.1:8080;
  46. index index.html;
  47.  
  48. access_log off;
  49. error_log /dev/null crit;
  50.  
  51. root /usr/local/nginx/html;
  52. location = /nop.gif {
  53. empty_gif;
  54. }
  55. location /imgs {
  56. autoindex on;
  57. }
  58. }
  59. }
  60. # -----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement