Advertisement
Guest User

nginx.conf

a guest
Jul 19th, 2016
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.18 KB | None | 0 0
  1. #D I E T - P I
  2. # /etc/nginx/nginx.conf
  3.  
  4. user www-data;
  5.  
  6. # As a thumb rule: One per CPU.
  7. worker_processes 4;
  8.  
  9. # Maximum file descriptors that can be opened per process
  10. # This should be > worker_connections
  11. worker_rlimit_nofile 20;
  12.  
  13. events {
  14.     worker_connections 10;
  15. }
  16.  
  17. error_log /var/log/nginx/error.log;
  18.  
  19. pid /run/nginx.pid;
  20.  
  21. http {
  22.     client_max_body_size 32m;
  23.     charset utf-8;
  24.  
  25.     # Upstream to abstract back-end connection(s) for PHP
  26.     upstream php {
  27.         server unix:/run/php5-fpm.sock;
  28.     }
  29.  
  30.     # Set the mime-types via the mime.types external file
  31.     include mime.types;
  32.  
  33.     # And the fallback mime-type
  34.     default_type application/octet-stream;
  35.  
  36.     # Click tracking!
  37.     access_log off;
  38.  
  39.     # Hide nginx version
  40.     server_tokens off;
  41.  
  42.     # ~2 seconds is often enough for HTML/CSS, but connections in
  43.     # Nginx are cheap, so generally it's safe to increase it
  44.     keepalive_timeout 2;
  45.  
  46.     # You usually want to serve static files with Nginx
  47.     sendfile on;
  48.  
  49.     tcp_nopush on; # off may be better for Comet/long-poll stuff
  50.     tcp_nodelay off; # on may be better for Comet/long-poll stuff
  51.  
  52.     server_name_in_redirect off;
  53.     types_hash_max_size 2048;
  54.  
  55.     gzip off;
  56.     gzip_http_version 1.0;
  57.     gzip_comp_level 1;
  58.     gzip_min_length 512;
  59.     gzip_buffers 4 8k;
  60.     gzip_proxied any;
  61.     gzip_types
  62.         # text/html is always compressed by HttpGzipModule
  63.         text/css
  64.         text/plain
  65.         text/x-component
  66.         application/javascript
  67.         application/json
  68.         application/xml
  69.         application/xhtml+xml
  70.         application/x-font-ttf
  71.         application/x-font-opentype
  72.         application/vnd.ms-fontobject
  73.         image/svg+xml
  74.         image/x-icon;
  75.  
  76.     # This should be turned on if you are going to have pre-compressed copies (.gz) of
  77.     # static files available. If not it should be left off as it will cause extra I/O
  78.     # for the check. It would be better to enable this in a location {} block for
  79.     # a specific directory:
  80.     # gzip_static on;
  81.  
  82.     gzip_disable "msie6";
  83.     gzip_vary on;
  84.  
  85.     include /etc/nginx/conf.d/*.conf;
  86.     include /etc/nginx/sites-enabled/*;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement