I am trying to set up a simple software load balancer based on NGINX for two IIS web servers. Here is the NGINX configuration file I have created for the load balancing:
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
#####
# Definition von Load Balancing Cluster fur Share Point Farm
######
upstream SPcluster {
ip_hash;
server 172.22.1.134:80 weight=10 max_fails=3 fail_timeout=15;
server 172.22.1.133:80 weight=10 max_fails=3 fail_timeout=15;
}
server {
listen 172.22.9.100:80;
location / {
proxy_pass http://SPcluster;
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
The problem is, that wen i try to access the IP of the load balancer through a web browser I get the following error:
Server Error in '/' Application.
The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /SitePages/Homepage.aspx
What is wrong with my configuration? Why the nginx server tries to find the html files on the load balancer server and does not redirect the requests to the web servers that can actually server them?