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;
}
}
如对您有帮助,支持下呗!
微信
支付宝