Nginx反向代理设置

Nginx反向代理设置

1.nginx.conf文件结构:全局配置,events,http (http配置,负载均衡配置,多个sever)

image-20211227105115583

2.整个网站的首页请求,从128端口访问;admin请求走47端口

image-20211227110023175

3.Nginx反向代理与负载均衡

image-20211227110437426

upstream test{
	server 192.168.136.55:8080 weight=1;
	server 192.168.136.55:8081 weight=2;
}
server{
	listen 80;
	server_name localhost;
	
	location/{
	root html;
	index index.html index.htm;
	proxy_pass http://test;
	}
}
posted @ 2021-12-29 22:17  不会写代码的花生  阅读(94)  评论(0)    收藏  举报