mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 03:42:07 +08:00
128 lines
3.3 KiB
Nginx Configuration File
128 lines
3.3 KiB
Nginx Configuration File
#user xiaoju xiaoju;
|
|
|
|
worker_rlimit_nofile 204800;
|
|
worker_processes 4;
|
|
error_log /home/xiaoju/nginx/logs/error.log;
|
|
pid /home/xiaoju/nginx/run/nginx.pid;
|
|
|
|
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
|
|
include /home/xiaoju/nginx/modules/*.conf;
|
|
|
|
|
|
events {
|
|
use epoll;
|
|
worker_connections 204800;
|
|
|
|
accept_mutex on;
|
|
accept_mutex_delay 5ms;
|
|
multi_accept on;
|
|
}
|
|
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
server_names_hash_bucket_size 128;
|
|
#server_tag off;
|
|
#server_info off;
|
|
server_tokens off;
|
|
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
|
|
fastcgi_connect_timeout 5;
|
|
fastcgi_send_timeout 10;
|
|
fastcgi_read_timeout 10;
|
|
fastcgi_buffer_size 64k;
|
|
fastcgi_buffers 4 64k;
|
|
fastcgi_busy_buffers_size 128k;
|
|
fastcgi_temp_file_write_size 128k;
|
|
|
|
keepalive_timeout 60;
|
|
keepalive_requests 1024;
|
|
client_header_buffer_size 4k;
|
|
large_client_header_buffers 4 32k;
|
|
client_max_body_size 10m;
|
|
|
|
client_body_buffer_size 512k;
|
|
client_body_timeout 30;
|
|
client_header_timeout 10;
|
|
send_timeout 240;
|
|
|
|
proxy_connect_timeout 10s;
|
|
proxy_send_timeout 15s;
|
|
proxy_read_timeout 15s;
|
|
proxy_buffers 64 8k;
|
|
proxy_busy_buffers_size 128k;
|
|
proxy_temp_file_write_size 64k;
|
|
proxy_redirect off;
|
|
#proxy_upstream_tries 2;
|
|
proxy_next_upstream error invalid_header timeout http_502 http_504;
|
|
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_buffers 4 16k;
|
|
gzip_http_version 1.0;
|
|
gzip_comp_level 2;
|
|
gzip_types text/plain application/x-javascript text/css text/xml application/xml+css application/json text/javascript;
|
|
gzip_vary on;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Real-Port $remote_port;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_pass_header Server;
|
|
|
|
#operationid on;
|
|
#operationid_header didi-header-rid;
|
|
#operationid_eth eth0;
|
|
#proxy_set_header didi-header-rid $operationid;
|
|
|
|
log_format main '$server_addr\t$host\t'
|
|
'$remote_addr\t$http_x_forwarded_for\t'
|
|
'$time_local\t'
|
|
'$scheme\t$request\t'
|
|
'$status\t$upstream_status\t'
|
|
'$request_time\t$upstream_addr\t$upstream_response_time\t'
|
|
'$request_length\t$bytes_sent\t'
|
|
'$http_referer\t$http_cookie\t$http_user_agent\t'
|
|
'$limit_rate\t$http_didi_header_omgid\t$remote_port';
|
|
|
|
|
|
set_real_ip_from 10.0.0.0/8;
|
|
set_real_ip_from 100.64.0.0/10;
|
|
real_ip_header X-Real-IP;
|
|
|
|
server {
|
|
listen 8080 backlog=4096;
|
|
server_name localhost;
|
|
access_log logs/access.log main;
|
|
|
|
location = /status.do {
|
|
access_log off;
|
|
root /home/xiaoju/nginx/html;
|
|
}
|
|
|
|
location / {
|
|
root html;
|
|
index index.html index.htm;
|
|
if ( $args !~ '^\?' ){
|
|
proxy_pass http://127.0.0.1:8888;
|
|
}
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
}
|
|
|
|
include conf.d/*.conf;
|
|
# include servers/*.conf;
|
|
# include server_conf/*.conf;
|
|
# include upstream_conf/*.conf;
|
|
}
|