前后端动静分离
2022-10-03 16:57:57 9 举报
前后端动静分离
作者其他创作
大纲/内容
server { listen 80; server_name student.oldboylinux.cn; #前端 location / { root /app/code/exam/front/student/; index index.html; } #后端 location /api/ { proxy_pass http://{{ vip }}:8000; }}server { listen 80; server_name admin.oldboylinux.cn; #前端 location / { root /app/code/exam/front/admin/; index index.html; } #后端 location /api/ { proxy_pass http://{{ vip }}:8000; }}
把请求发到web上nginx
nginx
后端web集群
stream { upstream backend_pools { server 10.0.0.7:80; server 10.0.0.8:80; server 10.0.0.9:80; server 10.0.0.10:80; } server { listen 8000; proxy_pass backend_pools; }}
前端web集群
数据库
存储
负载均衡
4层负载
jar
upstream front_pools { server 10.0.0.7:80; server 10.0.0.8:80; server 10.0.0.9:80; server 10.0.0.10:80;}server { listen 80; server_name student.oldboylinux.cn; location / { proxy_pass http://front_pools; proxy_set_header Host $http_host; }}server { listen 80; server_name admin.oldboylinux.cn; location / { proxy_pass http://front_pools; proxy_set_header Host $http_host; }}
7层负载
0 条评论
下一页