this simple conf file does not work – it always connect to one server only (using Windows version 1.26.1)
<code>worker_processes 1;
events {
worker_connections 768;
}
http {
upstream myapp {
# ip_hash;
# hash $binary_remote_addr consistent;
server localhost:4000;
server localhost:4001;
}
server {
listen 4444 ssl;
server_name localhost;
ssl_certificate pem.pem;
ssl_certificate_key key.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
location / {
proxy_pass http://myapp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
</code>
<code>worker_processes 1;
events {
worker_connections 768;
}
http {
upstream myapp {
# ip_hash;
# hash $binary_remote_addr consistent;
server localhost:4000;
server localhost:4001;
}
server {
listen 4444 ssl;
server_name localhost;
ssl_certificate pem.pem;
ssl_certificate_key key.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
location / {
proxy_pass http://myapp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
</code>
worker_processes 1;
events {
worker_connections 768;
}
http {
upstream myapp {
# ip_hash;
# hash $binary_remote_addr consistent;
server localhost:4000;
server localhost:4001;
}
server {
listen 4444 ssl;
server_name localhost;
ssl_certificate pem.pem;
ssl_certificate_key key.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
location / {
proxy_pass http://myapp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
what can be the problem?
I tested it using server created on two different programming languages and it is same.
Thank you.