/nginx/nginx.conf

https://github.com/peter/rails-on-ubuntu · Config · 63 lines · 51 code · 12 blank · 0 comment · 0 complexity · 91dcfe9de7cbc29137bbc22a3a5e6d96 MD5 · raw file

  1. # user and group to run as
  2. user deploy deploy;
  3. # Nginx uses a master -> worker configuration.
  4. # number of nginx workers, 4 is a good minimum default
  5. # when you have multiple CPU cores I have found 2-4 workers
  6. # per core to be a sane default.
  7. worker_processes 4;
  8. # pid of nginx master process
  9. pid /var/run/nginx.pid;
  10. # Number of worker connections. 8192 is a good default
  11. # Nginx can use epoll on linux or kqueue on bsd systems
  12. events {
  13. worker_connections 8192;
  14. use epoll; # linux only!
  15. }
  16. # start the http module where we config http access.
  17. http {
  18. # pull in mime-types. You can break out your config
  19. # into as many include's as you want to make it cleaner
  20. include /usr/local/nginx/conf/mime.types;
  21. # set a default type for the rare situation that
  22. # nothing matches from the mimie-type include
  23. default_type application/octet-stream;
  24. # This log format is compatible with any tool like awstats
  25. # that can parse standard apache logs.
  26. log_format main '$remote_addr - $remote_user [$time_local] '
  27. '"$request" $status $body_bytes_sent "$http_referer" '
  28. '"$http_user_agent" "$http_x_forwarded_for"';
  29. # main access log
  30. access_log /usr/local/nginx/logs/access.log main;
  31. # main error log - Do not comment out. If you do
  32. # not want the log file set this to /dev/null
  33. error_log /usr/local/nginx/logs/error.log notice;
  34. # no sendfile on OSX
  35. sendfile on;
  36. # These are good default values.
  37. tcp_nopush on;
  38. tcp_nodelay on;
  39. # output compression saves bandwidth. If you have problems with
  40. # flash clients or other browsers not understanding the gzip format
  41. # them you may want to remove a specific content type that is affected.
  42. gzip on;
  43. gzip_http_version 1.0;
  44. gzip_comp_level 2;
  45. gzip_proxied any;
  46. gzip_types text/plain text/html text/css application/x-javascript
  47. text/xml application/xml application/xml+rss text/javascript;
  48. # this will include any vhost files we place in /etc/nginx/vhosts as
  49. # long as the filename ends in .conf
  50. include /usr/local/nginx/conf/vhosts/*.conf;
  51. }