SHARE
TWEET

nginx conf

a guest Apr 27th, 2017 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. user  nginx;
  3. worker_processes  2;
  4. worker_rlimit_nofile 65536;
  5.  
  6. error_log  /var/log/nginx/error.log warn;
  7. pid        /var/run/nginx.pid;
  8.  
  9.  
  10. events {
  11.     worker_connections  2048;
  12. }
  13.  
  14.  
  15. http {
  16.     fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=supercache:10m max_size=1000m inactive=60m;
  17.     fastcgi_cache_key "$scheme$request_method$host$request_uri";
  18.     include       /etc/nginx/mime.types;
  19.     default_type  application/octet-stream;
  20.  
  21.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  22.                   '$status $body_bytes_sent "$http_referer" '
  23.                   '"$http_user_agent" "$http_x_forwarded_for"';
  24.  
  25.     #Disable IFRAME
  26.     add_header X-Frame-Options SAMEORIGIN;
  27.    
  28.     #Prevent Cross-site scripting (XSS) attacks
  29.     add_header X-XSS-Protection "1; mode=block";
  30.    
  31.     #Prevent MIME-sniffing
  32.     add_header X-Content-Type-Options nosniff;
  33.    
  34.     access_log  off;
  35.     sendfile on;
  36.     tcp_nopush on;
  37.     tcp_nodelay off;
  38.     types_hash_max_size 2048;
  39.     server_tokens off;
  40.     server_names_hash_bucket_size 128;
  41.     client_max_body_size 200m;
  42.     client_body_buffer_size 256k;
  43.     client_body_in_file_only off;
  44.     client_body_timeout 60s;
  45.     client_header_buffer_size 256k;
  46.     client_header_timeout  20s;
  47.     large_client_header_buffers 8 256k;
  48.     keepalive_timeout 10;
  49.     keepalive_disable msie6;
  50.     reset_timedout_connection on;
  51.     send_timeout 60s;
  52.    
  53.     gzip on;
  54.     gzip_static on;
  55.     gzip_disable "msie6";
  56.     gzip_vary on;
  57.     gzip_proxied any;
  58.     gzip_comp_level 6;
  59.     gzip_buffers 16 8k;
  60.     gzip_http_version 1.1;
  61.     gzip_types text/plain text/css application/json text/javascript application/javascript text/xml application/xml application/xml+rss;
  62.  
  63.     include /etc/nginx/conf.d/*.conf;
  64. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top