2

I got the following configuration:

upstream backend { server xx.azurewebsites.net; server xxx.azurewebsites.net; } server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; server_name_; location / { proxy_pass http://backend; } } 

The problem is that the request always returns an Error 404 page: https://i.gyazo.com/cb0b81014aac8ea979ad77b246c79377.png

Accessing xx.azurewebsites.net or xxx.azurewebsites.net via the browser works but not when going through the load balancer. I have tried with other websites too besides azurewebsites.net and they display the 4040 page too.

Does someone know what I'm missing here?

nginx.conf:

user Azureuser; // I changed the user from www-user to Azureuser, did't help though worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; } http { sendfile on; tcp_nopush on; tcp:nodelay on; keepalive_timeout 65; types_hash_max_size 2448; include /etc/nginx/mime.tyoes; default_type application/octet-stream; gzip on; gzip_sidable "msie6"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } 

Loadbalancer: vm-lb-nginx.northeurope.cloudapp.azure.com

Server 1: spd1.azurewebsites.net

Server 2: spd2.azurewebsites.net

12
  • Reading point 1 in your blue 404 picture, I wonder whether the DNS indeed has been configured correctly? Commented Apr 26, 2016 at 20:20
  • It is, the page can be accessed via internet but not via the loadbalancer for some reason, same goes for other websites too such as Facebook, Fiverr etc. Commented Apr 26, 2016 at 20:22
  • But which domain do you use to access the load balancer? Commented Apr 26, 2016 at 20:28
  • I access it via IP. Commented Apr 26, 2016 at 20:31
  • Can you access the endpoints by ip directly too? Commented Apr 26, 2016 at 20:32

1 Answer 1

0
Ensure your can visit real server through 80 port.please have a try. If ok, you should check your dns about the domainName. upstream webservers { server xx.azurewebsites.netIP; server xxx.azurewebsites.netIP; } server { listen 80; server_name localhost; location / { index index.html index.htm; proxy_pass http://webservers; proxy_set_header X-Real-IP $remote_addr; } 
3
  • I just tried your solution but it showing this now: i.gyazo.com/cdabedb06729673f7f159dcb4cafb2f2.png All of the 3 servers can be accessed on port 80. EDIT: The index file is also available at the 2 end servers. Commented Apr 27, 2016 at 14:04
  • 403 means that you are forbiddened access the web page. Could you paste your the loadbalance part of nginx.conf and the url you vist the real server directly? Commented Apr 27, 2016 at 14:32
  • Added the config and URLs to the main post. Commented Apr 27, 2016 at 14:47

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.