nginx.conf 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # Config file based on sinatra's.
  2. # you generally only need one nginx worker unless you're serving
  3. # large amounts of static files which require blocking disk reads
  4. worker_processes 8;
  5. # # drop privileges, root is needed on most systems for binding to port 80
  6. # # (or anything < 1024). Capability-based security may be available for
  7. # # your system and worth checking out so you won't need to be root to
  8. # # start nginx to bind on 80
  9. # user nobody nogroup; # for systems with a "nogroup"
  10. #user nobody nobody; # for systems with "nobody" as a group instead
  11. # Feel free to change all paths to suite your needs here, of course
  12. # pid /tmp/nginx.pid;
  13. #error_log /tmp/nginx.error.log;
  14. error_log stderr error;
  15. events {
  16. worker_connections 4096; # increase if you have lots of clients
  17. accept_mutex off; # "on" if nginx worker_processes > 1
  18. use epoll; # enable for Linux 2.6+
  19. # use kqueue; # enable for FreeBSD, OSX
  20. }
  21. http {
  22. # nginx will find this file in the config directory set at nginx build time
  23. #include /usr/local/nginx/conf/mime.types;
  24. # fallback in case we can't determine a type
  25. default_type application/octet-stream;
  26. # click tracking!
  27. #access_log /tmp/nginx.access.log combined;
  28. access_log off;
  29. upstream nimrod {
  30. server localhost:9000;
  31. server localhost:9001;
  32. server localhost:9002;
  33. server localhost:9003;
  34. server localhost:9004;
  35. server localhost:9005;
  36. server localhost:9006;
  37. server localhost:9007;
  38. }
  39. server {
  40. # enable one of the following if you're on Linux or FreeBSD
  41. listen 8080 default deferred; # for Linux
  42. # listen 80 default accept_filter=httpready; # for FreeBSD
  43. client_max_body_size 4G;
  44. server_name _;
  45. # ~2 seconds is often enough for most folks to parse HTML/CSS and
  46. # retrieve needed images/icons/frames, connections are cheap in
  47. # nginx so increasing this is generally safe...
  48. keepalive_timeout 10;
  49. # path for static files
  50. root /path/to/app/current/public;
  51. # Prefer to serve static files directly from nginx to avoid unnecessary
  52. # data copies from the application server.
  53. #
  54. # try_files directive appeared in in nginx 0.7.27 and has stabilized
  55. # over time. Older versions of nginx (e.g. 0.6.x) requires
  56. # "if (!-f $request_filename)" which was less efficient:
  57. # http://bogomips.org/unicorn.git/tree/examples/nginx.conf?id=v3.3.1#n127
  58. #try_files $uri/index.html $uri.html $uri @app;
  59. location / {
  60. #include /usr/local/nginx/conf/scgi_params;
  61. #scgi_pass nimrod;
  62. proxy_pass http://nimrod;
  63. }
  64. }
  65. }