nginx 配置stream模块代理并开启日志配置
前言
nginx 1.20.1
nginx从1.9.0开始,新增加了一个stream模块
确保nginx 安装时开启stream模块
./configure \
…… \
--with-stream \
--with-stream_ssl_module \
修改nginx.conf
#增加stream配置,开启stream模块
stream {
log_format basic '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time';
access_log logs/stream-access.log basic buffer=32k;
server{
listen 6666;
proxy_pass 10.11.11.11:7777;
}
}
重新加载配置
# 测试一下配置文件写的是否有问题
shell> nginx -t
# 配置文件没问题的话,重新加载配置
shell> nginx -s reload
nginx 配置stream模块代理并开启日志配置的更多相关文章
- nginx的stream反向代理mysql配置
这里主要记录一下nginx的负载代理stream模块,首先编译的时候需要加上--with-stream, 就像这样 然后nginx.conf里面的配置是在http选项上面加上 #Mysql Rever ...
- nginx的stream模块和upstream模块
nginx7层调度方式 使用upstream模块定义集群名称和节点地址 定义在server字段之外httpd字段之内 upstream staticweb { server 172.17.0.2; # ...
- Nginx 如何设置反向代理 多服务器,配置区分开来,单独文件保存单个服务器 server 主机名配置,通过 include 实现
samcao 关注 2015.06.15 10:08* 字数 0 阅读 408评论 0喜欢 0 网络结构如上图.可能你只有一个公网的Ip地址. 但是您的内网有个网站需要映射至外网.而又不想添加其它 ...
- NGINX生产环境反向代理到后端tomcat配置
#当访问www.kazihuo.com//sichuan-user-te时,跳转到http://10.1.93.61:7005/sichuan-user server { listen ; serve ...
- Nginx基于TCP/UDP端口的四层负载均衡(stream模块)配置梳理
通过我们会用Nginx的upstream做基于http/https端口的7层负载均衡,由于Nginx老版本不支持tcp协议,所以基于tcp/udp端口的四层负载均衡一般用LVS或Haproxy来做.至 ...
- 编译nginx平滑添加stream模块
1.操作背景 操作系统版本:CentOS Linux release (Core) nginx版本:1.13.4 nginx从1.9.0版本开始,新增了ngx_stream_core_module模块 ...
- Linux安装Nginx安装并配置stream
编译安装 1.下载可编译的nginx cd /opt wget http://nginx.org/download/nginx-1.20.1.tar.gz tar -zxvf nginx-1.20.1 ...
- 现在使用Nginx实现TCP反向代理
Nginx 在1.9.0版本发布以前如果要想做到基于TCP的代理及负载均衡需要通过打名为 nginx_tcp_proxy_module 的第三方patch来实现,该模块的代码托管在github上网址: ...
- 使用Nginx实现TCP反向代理
Nginx 在1.9.0版本发布以前如果要想做到基于TCP的代理及负载均衡需要通过打名为 nginx_tcp_proxy_module 的第三方patch来实现,该模块的代码托管在github上网址: ...
- nginx : TCP代理和负载均衡的stream模块
一直以来,Nginx 并不支持tcp协议,所以后台的一些基于TCP的业务就只能通过其他高可用负载软件来完成了,比如Haproxy. 这算是一个nginx比较明显的缺憾.不过,在1.90发布后这个认知将 ...
随机推荐
- SV Clocking Review
clocking会设置input和output的延时 default input #3ns output #1ns 数据是在时钟上升沿驱动的,在时钟上升沿,将vld驱动到dut,dut中也会在时钟上升 ...
- [IDEA] - tomcat VM配置
-Dfile.encoding=UTF-8
- sql server 数据恢复
1) 备份当前数据库的事务日志:BACKUP LOG [数据库名] TO disk= N'备份文件名' WITH NORECOVERY 2) 恢复一个误删除之前的完全备份:RESTORE DATABA ...
- Matplotlib.pyplot.scatter 散点图绘制
Matplotlib.pyplot.plot 绘图 matplotlib.pyplot.scatter(x, y, s=None, c=None, marker=None, cmap=None, no ...
- [转帖]MySQL 8.2.0 GA
https://cloud.tencent.com/developer/article/2353798 MySQL新的进化版8.2.0于2023年10月25日发行,让我们一起快速浏览一下该版本发生哪些 ...
- 【转帖】查看mysql库大小,表大小,索引大小
https://www.cnblogs.com/lukcyjane/p/3849354.html 说明: 通过MySQL的 information_schema 数据库,可查询数据库中每个表占用的空间 ...
- [转帖]Linux中最全shell命令&常用注意事项
在编辑linux脚本中不断的会用到复杂的脚本编辑,写文章记录. Linux命令大全(手册) – 真正好用的Linux命令在线查询网站 目录 推荐书籍: Linux常用命令 Linux 常用命令 在li ...
- Vue2 里如何优雅的清除一个定时器
绝大多数人清除定时器的方法 <script> export default { data() { return { timer: null } }, mounted() { this.ti ...
- js设置setAttribute、获取getAttribute、删除removeAttribute详细讲解
setAttribute的理解 所有主流浏览器均支持 setAttribute() 方法. element.setAttribute(keys,cont) keys==>必需(String类型) ...
- js解析上传APK文件的详细信息
前端解析APK版本信息 需要安装这个包,可以使用cnpm或者npm npm 安装 app-info-parser ( 命令:npm install app-info-parser) APKInfo为i ...