码迷,mamicode.com
首页 > 其他好文 > 详细

nginx配置

时间:2015-11-27 17:19:52      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

vi nginx.conf
user  tomcat;
worker_processes  10;
worker_rlimit_nofile 65535;
pid /var/run/nginx.pid;

events {
   use epoll;
    worker_connections 65536;
}

http {
    #rewrite_log on;
    server_tokens off;
    include       mime.types;
    default_type  application/octet-stream;
    set_real_ip_from 10.0.0.0/8;
    real_ip_header X-Forwarded-For;
    client_header_buffer_size 16k;
    large_client_header_buffers 4 16k;
    client_max_body_size 5M;	
    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
                      ‘$status $body_bytes_sent "$http_referer" ‘
                      ‘"$http_user_agent" "$http_x_cookie" "$request_time" "$upstream_response_time" "$upstream_cache_status"‘;

    access_log  logs/access.log  main;
    error_log   logs/error.log;
        
    send_timeout 60;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 30;
    types_hash_max_size 2048;
   
    proxy_connect_timeout 600;
    proxy_read_timeout 600;
    proxy_send_timeout 600;
    proxy_buffer_size 128k;
    proxy_buffers 4 128k;
    proxy_busy_buffers_size 128k;
    proxy_temp_file_write_size 128k;
    proxy_temp_path /wdzj/lnmp/nginx/cache_temp/temp_dir;
    proxy_cache_path /wdzj/lnmp/nginx/cache_temp/nginxcache levels=1:2 keys_zone=cache_one:200m inactive=1d max_size=5g;
    include conf.d/*.conf;
}

  

nginx配置

标签:

原文地址:http://www.cnblogs.com/zenghui940/p/5000737.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!