NGINX does not resolve the upstream-block in a reverse proxy and load-balancing application.
I've two server running with ubuntu 22.04.2 LTS. Each of them are in a local network with IP 192.168.2.100 and .101. Nginx is the version 1.18.0 (ubuntu) On each engin runs minio in a proper way, listend on port 9000. In addition I've installed nginx on the first one (192.168.2.100). My configuration in is:
upstream minioserver {
server 192.168.2.100:9000;
server 192.168.2.101:9000;
}
server {
listen 80;
server_name 192.168.2.100;
location / {
proxy_pass http://minioserver;
}
}
In case I'm calling from an extern device the server 192.168.2.100, I expect an redirection to one of the minio-server. Instead, a redirection to the address "minioserver:9000" is performed. Minioserver, however, is the upstream and not one of the servers to which the request should be forwarded. Accordingly, I receive an error message on the requesting computer, because minioserver does not exist in the network.Using the server names instead of the IP addresses always shows the same behavior. All searches have so far been unsuccessful. Simple forwarding with proxy_pass http://192.168.2.100:9000 or .101:9000 works correctly and correctly connects the requesting client to the appropriate Minio server. Now I hope very much for a solution.
I tried the substitution of IP's by corresponding server name (minio-01:900; minio-02:9000). In addition I tried to use the directive resolve ... too. All these variants did not work. MinIO also gives a reference configuration that does not work either.