yum安装Nginx并支持TCP代理

安装命令

sudo yum install epel-release -y 
sudo  yum install nginx nginx-mod-stream -y
systemctl status nginx
systemctl start nginx

修改配置文件
vim "/etc/nginx/nginx.conf" 在http模块下添加

TCP方向代理

stream {

upstream harbor-80 {

server 172.16.16.26:80;

}

server {

listen 80;

proxy_pass harbor-80;

tcp_nodelay on;

}

upstream harbor-443 {

server 172.16.16.26:443;

}

server {

listen 443;

proxy_pass harbor-80;

tcp_nodelay on;

}

}
posted @ 2022-04-17 13:47  西门运维  阅读(276)  评论(0编辑  收藏  举报