nginx.conf

来源:互联网 发布:外贸邮件营销软件源码 编辑:程序博客网 时间:2024/05/21 08:55
user root;worker_processes 4;worker_rlimit_nofile 65535;error_log logs/error.log;pid logs/nginx.pid;events{use epoll;worker_connections 65535;}http{upload_progress proxied 8m;upload_progress_json_output;include mime.types;default_type application/octet-stream;server_names_hash_bucket_size 128;client_header_buffer_size 12m;large_client_header_buffers 4 12m;     sendfile on;tcp_nopush on;keepalive_timeout 3600;tcp_nodelay on;client_body_buffer_size 512k;proxy_connect_timeout 5;proxy_read_timeout 3600;proxy_send_timeout 5;proxy_buffer_size 16k;proxy_buffers 4 64k;proxy_busy_buffers_size 128k;proxy_temp_file_write_size 128k;gzip on;gzip_min_length 1k;gzip_buffers 4 8k;gzip_http_version 1.1;gzip_types text/plain application/x-javascript text/css  application/xml;gzip_disable "MSIE [1-6]\.(?!.*SV1)";gzip_vary on;log_format main '$remote_addr - $remote_user [$time_local] "$request" '             '$status $body_bytes_sent "$http_referer" '             '"$http_user_agent" $http_x_forwarded_for';upstream application{server 192.168.2.201:8080 weight=1;}server{listen 80;server_name alexgaoyh.com;access_log logs/application.log main;error_page 400 403 404 500 501 502 503 504 505  /404.html;location = /404.html {root exceptionPage;}root /home/alexgaoyh/xctv;location / {index html/index.html;}location ^~ /admin/ {root /home/alexgaoyh/soft/cms/webapps/ROOT/;proxy_set_header Host $host;                proxy_set_header X-Real-IP  $remote_addr;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_next_upstream http_404 http_500 http_502 http_503 error timeout invalid_header;proxy_pass http://application/;}location ~ .*\.(js|css|gif|jpg|jpeg|png|bmp|swf)$ {expires 12h;}location ~ .*\.(html|htm)$ {expires 5m;}location ~* \.flv {flv;limit_rate_after 5m;limit_rate 300k;}location ~* \.mp4 {mp4;limit_rate_after 10m;limit_rate 500k; }location ^~ /upload  {upload_limit_rate 0;upload_cleanup 400 404 499 500-505;client_max_body_size 4096m;  proxy_pass http://application/upload/Upload.xctv!;track_uploads proxied 5s;  }location ^~ /pgs {  report_uploads  proxied;}        }}