1、nginx中的ip_local_port_range问题
# sysctl -a | grep ip_local
net.ipv4.ip_local_port_range = 32768 61000
# sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 10240 61000
2、nginx.conf
upstream p2p_service {
keepalive 50;
server 127.0.0.1:29980;
server 127.0.0.1:29981;
}
server {
listen 29080;
server_name v2.hongbaodai.com;
location / {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy-add_x_forwarded_for;
proxy_connect_timeout 3;
proxy_send_timeout 3;
proxy_read_timeout 3;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_pass http://p2p_service;
proxy_redirect default ;
}
}