user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_rlimit_nofile 20480; events { use epoll; worker_connections 20480; multi_accept on; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; #请求量级大建议关闭acccess_log #access_log /var/log/nginx/access.log main; #fastcgi_intercept_errors on; #proxy_intercept_errors on; #error_page 404 /data/web/404.html; sendfile on; #tcp_nopush on; keepalive_timeout 65; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_types application/javascript application/json; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; server { listen 80; root /usr/share/nginx/html; charset utf-8; client_max_body_size 75M; location / { # root /usr/share/nginx/html; index /index.html; try_files $uri $uri/ /index.html; } } }