nginx.confjavascript
#user nobody root; user root; worker_processes 4; pid /run/nginx.pid; worker_rlimit_nofile 65535; events { use epoll; multi_accept on; worker_connections 65535; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$request_time $upstream_response_time ' '$status $body_bytes_sent "$http_referer" $request_body ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /usr/local/tengine/logs/access_api.log main buffer=32k; #access_log nul; error_log /var/log/nginx/error.log; charset utf-8; types_hash_max_size 2048; server_names_hash_bucket_size 64; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 300m; sendfile on; tcp_nopush on; tcp_nodelay on; #ssl ?? #ssl on; #ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv3; #ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM; #ssl_prefer_server_ciphers on; #?????????? #ssl_session_cache shared:SSL:20m; #ssl_session_timeout 10m; #ssl_certificate /usr/local/tengine/ssl/ipay2016.crt; #ipay??????? #ssl_certificate_key /usr/local/tengine/ssl/ipay2016.key; # timeout?????DOS?? client_header_timeout 30; keepalive_timeout 60; send_timeout 60; # ??????????DOS?? #limit_req_zone $binary_remote_addr zone=one:50m rate=50r/s; #limit_conn_zone $binary_remote_addr zone=addr:50m; proxy_redirect off; # proxy_redirect on; proxy_ignore_client_abort on; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_body_buffer_size 512k; proxy_connect_timeout 5; proxy_send_timeout 5; proxy_read_timeout 60; proxy_buffer_size 64k; proxy_buffers 4 64k; proxy_busy_buffers_size 128k; proxy_temp_file_write_size 512k; proxy_intercept_errors on; fastcgi_connect_timeout 30; fastcgi_send_timeout 15; fastcgi_read_timeout 15; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 512k; gzip on; gzip_disable "msie6"; gzip_min_length 2k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 6; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_vary on; server_tokens off; include /usr/local/tengine/conf/vhosts/*.conf; #include /usr/local/tengine/conf/vhosts/test.conf; }
cd /usr/local/tengine/conf/vhostscss
touch test.confhtml
server { listen 80; server_name 172.16.1.37; location / { autoindex on; autoindex_exact_size off; autoindex_localtime on; root /data; index index.html; } location = /favicon.ico { log_not_found off; access_log off; } }