本文共 874 字,大约阅读时间需要 2 分钟。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # tcp协议虚拟主机的配置文件模板 # cat /usr/local/nginx/conf/tcp/tcp.test.com.conf user nginx; worker_processes auto; worker_rlimit_nofile 102400; error_log /data0/log/tcp . test .com.error.log info; events { use epoll; worker_connections 25600; } http { include 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"' ; access_log /data0/log/nginx/tcp . test .com.log main; } stream { upstream tcp. test .com { server 1.1.1.1:61233; } server { listen 61233; proxy_pass tcp. test .com; proxy_connect_timeout 10d; proxy_timeout 1d; tcp_nodelay on; } } |