nginx通用配置

 1 user  nginx;
 2 worker_processes  auto;
 3 pid        run/nginx.pid;
 4 worker_rlimit_nofile 65536;
 5 error_log logs/nginx_error.log;
 6 #load_module /usr/local/nginx/modules/ngx_stream_module.so;
 7 
 8 events {
 9     use epoll;
10     worker_connections  65536;
11     multi_accept on;
12 }
13 #include stream.d/*.conf;
14 http {
15     include       mime.types;
16     default_type  application/octet-stream;
17     map $http_upgrade $connection_upgrade {
18         default upgrade;
19         '' close;
20     }
21 
22 
23     log_format  main  '$remote_addr $remote_port $ssl_protocol [$time_iso8601] "$request_method $scheme://$host$request_uri $server_protocol" '
24                       '$status $body_bytes_sent "$http_referer" '
25                       '{$http_user_agent} "$http_x_forwarded_for" "$request_time" "$upstream_addr" "$upstream_response_time"' ;
26 
27     access_log  /home/nginx_log/access.log  main;
28     server_names_hash_bucket_size 51200;
29     client_header_buffer_size 64k;
30     large_client_header_buffers 4 64k;
31     client_max_body_size 1024m;
32     sendfile        on;
33     tcp_nopush     on;
34     server_tokens off;
35     send_timeout 120;
36     keepalive_timeout  120;
37     gzip  on;
38     gzip_buffers 128 32k;
39     gzip_types text/plain application/javascript text/css application/xml;
40     gzip_static on;
41     gzip_min_length  1k;
42     gzip_http_version 1.1;
43     gzip_proxied any;
44     gzip_disable "MSIE [1-6]\.";
45     gzip_comp_level 6;
46     proxy_set_header   Host             $host;
47     proxy_set_header   X-Forwarded-For   $http_x_forwarded_for;
48     proxy_http_version 1.1;
49     proxy_buffer_size 512k;
50     proxy_buffers 128 32k;
51     proxy_busy_buffers_size 512k;
52     proxy_connect_timeout 60s;
53     proxy_cookie_domain off;
54     proxy_ignore_client_abort off;
55     proxy_intercept_errors on;
56     proxy_read_timeout 60s;
57     proxy_ssl_session_reuse on;
58     proxy_set_header x-forwarded-proto $scheme;
59 
60 #server {
61 #       listen       80;
62 #        server_name _ ;
63 #        location / {
64 #       return 403;
65 #        }
66 #}
67 
68 include webconf/*.conf;
69 }

猜你喜欢

转载自www.cnblogs.com/nullecho/p/9969493.html