nginx作为负载均衡(代理转发)时的配置文件样例nginx.conf
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了nginx作为负载均衡(代理转发)时的配置文件样例nginx.conf,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1048字,纯文字阅读大概需要2分钟。
内容图文
![nginx作为负载均衡(代理转发)时的配置文件样例nginx.conf](/upload/InfoBanner/zyjiaocheng/952/b41ab24a48834965b1f1f9f7e435541f.jpg)
worker_processes 1;
events {
use epoll;
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream springboot_group {
# If there is no specific strategy, round-robin
# would be the default strategy.
# least_conn;
# ip_hash;
server 10.1.82.44:8080 weight=1 max_fails=2 fail_timeout=30s;
#server 10.1.82.191:4080 weight=1 max_fails=2 fail_timeout=30s;
}
upstream tomcat_group {
# If there is no specific strategy, round-robin
# would be the default strategy.
# least_conn;
# ip_hash;
server 10.1.82.44:8081;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://springboot_group;
}
}
server {
listen 81;
server_name localhost;
location / {
proxy_pass http://tomcat_group;
}
}
}
内容总结
以上是互联网集市为您收集整理的nginx作为负载均衡(代理转发)时的配置文件样例nginx.conf全部内容,希望文章能够帮你解决nginx作为负载均衡(代理转发)时的配置文件样例nginx.conf所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。