I am getting the below error - I am doing this in my local machine with docker desktop - fyi
web-1 | 2024/10/08 01:08:24 [emerg] 12#12: bind() to 10.101.121.15:443 failed (99: Cannot assign requested address) web-1 | nginx: [emerg] bind() to 10.111.121.13:443 failed (99: Cannot assign requested address)
http {
upstream backend {
server cluster_1.ingress.com:443;
server cluster_2.ingress.com:443; max_fails=2 fail_timeout=1s;
}
server {
listen cluster_1.ingress.com:443;
location / {
resolver dns-default.openshift-dns;
proxy_pass https://backend;
proxy_pass_request_headers on;
proxy_ssl_server_name on;
proxy_ssl_name cluster_1.ingress.com;
proxy_set_header Host cluster_1.ingress.com;
}
}
server {
listen cluster_2.ingress.com;
location / {
resolver dns-default.openshift-dns;
proxy_pass "https://cluster_2.ingress.com";
proxy_pass_request_headers on;
proxy_ssl_server_name on;
proxy_ssl_name cluster_2.ingress.com;
proxy_set_header Host cluster_2.ingress.com;
}
}
server {
listen 8080 default_server;
listen [::]:8080 default_server;
root /usr/share/nginx/html;
server_name _;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Headers Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,PUT,DELETE,PATCH;
location / {
resolver dns-default.openshift-dns;
proxy_pass $backend;
}
}
}
This issue is tend around Nginx from what is see above trying to bind to specific IP addresses on port 443. This error typically occurs when the IP address you're trying to bind to isn't available on your local machine.
Some few steps you can work with in troubleshooting and resolve this issue:
Check IP Addresses: Ensure that the IP addresses 10.101.121.15 and 10.111.121.13 are correctly configured on your local machine. You can use the ifconfig or ip addr command to list all available IP addresses.
Modify Nginx Configuration: If those IP addresses are not available, you might need to update your Nginx configuration file to use an available IP address or 0.0.0.0 to bind to all available interfaces. The configuration file is usually located at
/etc/nginx/nginx.conf or /etc/nginx/sites-available/default. server { listen 443 ssl; server_name your_domain.com; ... }
Check for Conflicts: Ensure that no other services are using port 443 on the specified IP addresses. You can check this by running sudo lsof -i :443 or netstat -tuln | grep :443.
Restart Docker and Nginx: Sometimes, simply restarting Docker and Nginx can resolve binding issues. You can restart Docker Desktop and then restart Nginx with the following commands:
sudo systemctl restart nginx