前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >HAproxy 基础8

HAproxy 基础8

作者头像
franket
发布2022-01-19 11:10:52
3440
发布2022-01-19 11:10:52
举报
文章被收录于专栏:技术杂记

启动nginx,作为一个后端的web服务器

代码语言:javascript
复制
[root@h102 nginx]# sbin/nginx  -t -c conf/nginx.conf
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@h102 nginx]# sbin/nginx   -c conf/nginx.conf
[root@h102 ~]# netstat  -ant | grep 80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      
[root@h102 ~]# 
nginx.png
nginx.png

修改haproxy配置

代码语言:javascript
复制
[root@h102 ~]# vim /etc/haproxy/transparent_proxy.cfg
[root@h102 ~]# grep -v "^#" /etc/haproxy/transparent_proxy.cfg 

global
defaults
	timeout client		30s
	timeout server		30s
	timeout connect		30s

frontend MyFrontend
	bind	0.0.0.0:1234
	default_backend		TransparentBack_http

backend TransparentBack_http
	mode			http
	server			MyWebServer 127.0.0.1:80

[root@h102 ~]#

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档