Advertisement
livefree

nginx.conf

Jan 29th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. user  nginx;
  2. worker_processes  4;
  3.  
  4. error_log  /var/log/nginx/error.log warn;
  5. pid        /var/run/nginx.pid;
  6.  
  7.  
  8. events {
  9.     worker_connections  1024;
  10.  
  11.     # added from http://calendar.perfplanet.com/2012/using-nginx-php-fpmapc-and-varnish-to-make-wordpress-websites-fly/ - 28th Dec 2012
  12.    multi_accept on;
  13.     use epoll;
  14. }
  15.  
  16.  
  17. http {
  18.  
  19.     # Let NGINX get the real client IP for its access logs - added from http://calendar.perfplanet.com/2012/using-nginx-php-fpmapc-and-varnish-to-make-wordpress-websites-fly/ - 28th Dec 2012
  20.    set_real_ip_from 127.0.0.1;
  21.     real_ip_header X-Forwarded-For;
  22.  
  23.     include       /etc/nginx/mime.types;
  24.     default_type  application/octet-stream;
  25.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  26.                       '$status $body_bytes_sent "$http_referer" '
  27.                       '"$http_user_agent" "$http_x_forwarded_for"';
  28.  
  29.     access_log  /var/log/nginx/access.log  main;
  30.  
  31.     sendfile        on;
  32.     #tcp_nopush     on;
  33.    
  34.     # added from http://calendar.perfplanet.com/2012/using-nginx-php-fpmapc-and-varnish-to-make-wordpress-websites-fly/ - 28th Dec 2012
  35.    tcp_nopush     on;
  36.     client_max_body_size 15m;
  37.     client_body_timeout 60;
  38.     client_header_timeout 60;
  39.     client_body_buffer_size  128K;
  40.     client_header_buffer_size 1k;
  41.     large_client_header_buffers 4 8k;
  42.     send_timeout 60;
  43.     reset_timedout_connection on;
  44.     types_hash_max_size 2048;
  45.     server_tokens off;
  46.     gzip on;
  47.     gzip_static on;
  48.     gzip_min_length 512;
  49.  
  50.  
  51.     keepalive_timeout  20;
  52.  
  53.     gzip_http_version 1.1;
  54.     gzip_vary on;
  55.     gzip_comp_level 6;
  56.     gzip_proxied any;
  57.     gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
  58.     gzip_buffers 16 8k;
  59.     gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  60.     include /etc/nginx/conf.d/*.conf;
  61.  
  62.     port_in_redirect off;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement