文件名称nginx.conf
user www;
worker_processes 2;
error_log /data/nginx/logs/error.log error;
pid /var/run/nginx/nginx.pid;
events {
worker_connections 10240;
use epoll;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
client_body_buffer_size 16k;
client_body_temp_path /tmp/client_body_temp;
client_body_timeout 30;
client_header_buffer_size 64k;
large_client_header_buffers 4 64k;
client_header_timeout 30;
client_max_body_size 64m;
keepalive_timeout 3;
tcp_nodelay on;
send_timeout 30;
sendfile on;
tcp_nopush on;
server_names_hash_max_size 512;
server_names_hash_bucket_size 128;
server_tokens off;
open_file_cache off;
#index
index index.php index.html index.htm;
#fastcgi
fastcgi_connect_timeout 60;
fastcgi_read_timeout 60;
fastcgi_send_timeout 60;
fastcgi_temp_path /tmp/fastcgi_temp 1 2;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_max_temp_file_size 256k;
fastcgi_intercept_errors on;
fastcgi_index index.php;
#proxy
proxy_temp_path /tmp/proxy_temp;
proxy_buffer_size 4k;
proxy_buffering on;
proxy_buffers 256 4k;
proxy_busy_buffers_size 8k;
#gzip
gzip on;
gzip_buffers 64 4k;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_min_length 1024;
gzip_types text/css text/xml text/plain text/vnd.wap.wml application/x-javascript application/rss+xml application/xhtml+xml;
#realip module
set_real_ip_from 127.0.0.1;
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 172.16.0.0/20;
set_real_ip_from 192.168.0.0/16;
set_real_ip_from 192.168.1.0/24;
real_ip_header X-Real-IP;
#real_ip_header X-Forwarded-For;
#log
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#virtualhost
include vhosts/*.conf;
}