28 lines
800 B
Plaintext
28 lines
800 B
Plaintext
# nginx LB for the AI engine tier of docker-compose-cluster.yml.
|
|
# Round-robin is safe (engine is stateless). The separate LB hop exists because the JVM
|
|
# caches DNS lookups for the process lifetime, so compose round-robin DNS would pin each
|
|
# JVM to one engine and defeat scaling.
|
|
|
|
events { worker_connections 1024; }
|
|
|
|
http {
|
|
upstream stirling_engine {
|
|
server engine-1:5001;
|
|
server engine-2:5001;
|
|
}
|
|
|
|
server {
|
|
listen 5001;
|
|
|
|
# Matches JVM multipart cap; nginx default 1MB would 413.
|
|
client_max_body_size 2000m;
|
|
|
|
location / {
|
|
proxy_pass http://stirling_engine;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $host;
|
|
proxy_read_timeout 600s;
|
|
}
|
|
}
|
|
}
|