first commit
This commit is contained in:
commit
ba848e218d
1001 changed files with 152333 additions and 0 deletions
21
linux基础/nginx/使用nginx代理socket.txt
Normal file
21
linux基础/nginx/使用nginx代理socket.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
编译安装nginx时,需要在编译参数中加上--with-stream
|
||||
windows下的nginx直接配置nginx.conf即可
|
||||
在nginx.conf的events的同级目录配置stream块,如下示例
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
stream {
|
||||
upstream socket_server{
|
||||
server 127.0.0.1:3802 weight=1;
|
||||
server 127.0.0.1:3803 weight=1;
|
||||
}
|
||||
#监听socket端口
|
||||
server {
|
||||
listen 3801;
|
||||
proxy_pass socket_server;
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_timeout 300s
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue