nginx stream代理
生活随笔
收集整理的這篇文章主要介紹了
nginx stream代理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言
- nginx 1.12.2
- nginx從1.9.0開始,新增加了一個stream模塊
- nginx 安裝參考這里
- linux RedHat7
開啟stream
修改/etc/nginx/nginx.conf
#增加stream配置,開啟stream模塊 stream {log_format basic '$remote_addr [$time_local] ''$protocol $status $bytes_sent $bytes_received ''$session_time';access_log /var/log/nginx/stream-access.log basic buffer=32k;# 為了讓這個配置文件簡單一些,將配置stream放入到/etc/nginx/conf.d,并以.stream做后綴名。# 需要為每個端口創建一個.stream做后綴名的配置文件include /etc/nginx/conf.d/*.stream; }新增一個Stream代理
添加7000端口的stream代理配置。
新增配置/etc/nginx/conf.d/proxy_port7000_to_59.110.xxx.xxxp8001.stream
重新加載配置
# 測試一下配置文件寫的是否有問題 shell> nginx -t # 配置文件沒問題的話,重新加載配置 shell> nginx -s reload總結
以上是生活随笔為你收集整理的nginx stream代理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一个眼睛大一个眼睛小是怎么回事
- 下一篇: 用Gson实现json与对象、list集