user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { worker_connections 4096; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '[$request_time] [$upstream_response_time] $remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; map $http_upgrade $connection_upgrade { default upgrade; '' close; } access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; client_max_body_size 50m; keepalive_timeout 65; gzip on; gzip_comp_level 5; gzip_min_length 1024; gzip_types text/html application/javascript application/json text/css; server_tokens off; map $http_origin $allow_origin { default ""; "~^(https?://localhost(:[0-9]+)?)$" $1; "~^(https?://127.0.0.1(:[0-9]+)?)$" $1; "~^(https?://172.10(.[\d]+){2}(:[0-9]+)?)$" $1; "~^(https?://192.168(.[\d]+){2}(:[0-9]+)?)$" $1; "~^(http://msa.js.sgcc.com.cn:6001)$" $1; "~^(http://20.47.197.214:9098)$" $1; "~^(http://21.47.224.120:19098)$" $1; } include /etc/nginx/conf.d/*.conf; }