This message was deleted.
# k3s
a
This message was deleted.
1
w
So I spun up a container using NGINX 1.24 (current stable ver) and the suggested config as on the Rancher page does not work. Also, it is missing a map for the SSL cert path.
I am using this config, which does work (although I’m not certain yet that it works to proxy traffic to Rancher OK, since I have not installed Rancher yet.)
Copy code
worker_processes 4;
worker_rlimit_nofile 40000;

events {
    worker_connections 8192;
}

http {
    upstream backend {
        # Use the 'least_conn' load balancing method
        least_conn;

        # Specify the servers and their weights
        server 192.168.1.100 max_fails=3 fail_timeout=5s;
        server 192.168.1.101 max_fails=3 fail_timeout=5s;
    }

    # Define the server block for HTTP requests
    server {
        # Listen on port 80 for HTTP
        listen 80;

        # Redirect all HTTP requests to HTTPS
        return 301 https://$host$request_uri;
    }

    # Define the server block for HTTPS requests
    server {
        # Listen on port 443 for HTTPS
        listen 443 ssl;

        # Specify the SSL certificate and key files
        ssl_certificate /etc/ssl/certs/rancher.pem;
        ssl_certificate_key /etc/ssl/private/rancher_private.key;

        # Proxy the requests to the upstream group
        location / {
            proxy_pass <https://backend>;
        }
    }
}
Docker container run cmd line is:
Copy code
docker run -d --restart=unless-stopped   -p 80:80 -p 443:443 -v /etc/nginx.conf:/etc/nginx/nginx.conf -v /etc/ssl:/etc/ssl --name nginx_lb  nginx:stable