nginx作为tcp代理 虚拟主机配置 模板

简介:
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;
     }
}










本文转自 wpf926 51CTO博客,原文链接:http://blog.51cto.com/wupengfei/1958142,如需转载请自行联系原作者
目录
相关文章
|
16天前
|
移动开发 前端开发 JavaScript
前端vue2、vue3去掉url路由“ # ”号——nginx配置(一)
前端vue2、vue3去掉url路由“ # ”号——nginx配置
49 0
|
16天前
|
前端开发 JavaScript 应用服务中间件
前端vue2、vue3去掉url路由“ # ”号——nginx配置(二)
前端vue2、vue3去掉url路由“ # ”号——nginx配置
47 0
|
21小时前
|
应用服务中间件 nginx
nginx配置集群轮训策略
nginx配置集群轮训策略
9 0
|
1天前
|
安全 网络协议 应用服务中间件
一文读懂HTTPS⭐揭秘加密传输背后的原理与Nginx配置攻略
一文读懂HTTPS⭐揭秘加密传输背后的原理与Nginx配置攻略
|
2天前
|
网络协议 应用服务中间件 nginx
nginx 302 301 设置 url 转跳 nginx 资源重定向 nginx tcp 和 http 转发
nginx 代理后端网站,和 网站资源目录重定向到其他连接地址
25 3
|
9天前
|
应用服务中间件 PHP nginx
php如何实现检测nginx配置的正确性
请确保在执行此操作时,PHP有足够的权限来执行Nginx命令和访问Nginx配置文件。另外,将上述代码嵌入到您的应用程序中时,要注意安全性,以防止潜在的命令注入攻击。
50 3
|
16天前
|
安全 应用服务中间件 网络安全
linux_nginx中添加ssl配置(open ssl)
linux_nginx中添加ssl配置(open ssl)
25 1
|
16天前
|
JSON JavaScript 前端开发
vue2_vite.config.js的proxy跨域配置和nginx配置代理有啥区别?
vue2_vite.config.js的proxy跨域配置和nginx配置代理有啥区别?
32 1
|
负载均衡 网络协议 关系型数据库
通过Nginx TCP反向代理实现Apache Doris负载均衡
Nginx能够实现HTTP、HTTPS协议的负载均衡,也能够实现TCP协议的负载均衡。那么,问题来了,可不可以通过Nginx实现Apache Doris数据库的负载均衡呢?答案是:可以。接下来,就让我们一起探讨下如何使用Nginx实现Apache Doris的负载均衡。
365 0
|
负载均衡 算法 网络协议