/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
- # user and group to run as
- user deploy deploy;
- # Nginx uses a master -> worker configuration.
- # number of nginx workers, 4 is a good minimum default
- # when you have multiple CPU cores I have found 2-4 workers
- # per core to be a sane default.
- worker_processes 4;
- # pid of nginx master process
- pid /var/run/nginx.pid;
- # Number of worker connections. 8192 is a good default
- # Nginx can use epoll on linux or kqueue on bsd systems
- events {
- worker_connections 8192;
- use epoll; # linux only!
- }
- # start the http module where we config http access.
- http {
- # pull in mime-types. You can break out your config
- # into as many include's as you want to make it cleaner
- include /usr/local/nginx/conf/mime.types;
- # set a default type for the rare situation that
- # nothing matches from the mimie-type include
- default_type application/octet-stream;
- # This log format is compatible with any tool like awstats
- # that can parse standard apache logs.
- log_format main '$remote_addr - $remote_user [$time_local] '
- '"$request" $status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- # main access log
- access_log /usr/local/nginx/logs/access.log main;
- # main error log - Do not comment out. If you do
- # not want the log file set this to /dev/null
- error_log /usr/local/nginx/logs/error.log notice;
- # no sendfile on OSX
- sendfile on;
- # These are good default values.
- tcp_nopush on;
- tcp_nodelay on;
- # output compression saves bandwidth. If you have problems with
- # flash clients or other browsers not understanding the gzip format
- # them you may want to remove a specific content type that is affected.
- gzip on;
- gzip_http_version 1.0;
- gzip_comp_level 2;
- gzip_proxied any;
- gzip_types text/plain text/html text/css application/x-javascript
- text/xml application/xml application/xml+rss text/javascript;
- # this will include any vhost files we place in /etc/nginx/vhosts as
- # long as the filename ends in .conf
- include /usr/local/nginx/conf/vhosts/*.conf;
- }