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;
}
}
}