Muki
Muki

Reputation: 25

Azure App Service getting Error 404 when redirected via NGINX

  1. I created a VM, port 80 is open and installed NGINX on it.
  2. I created 2 App Services which can be accessed via x1.azurewebsites.net and x2.azurewebsites.net

I configured the VM to act as an load balancer but when redirecting the traffic I get the following: https://i.gyazo.com/b94bed9c90d3b0f0c400c83f762f0544.png

I am not using my own domain. Does someone know what the issue could be?

I got the following configurations:

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;
  }

}

Upvotes: 1

Views: 3426

Answers (1)

Julien Corioland
Julien Corioland

Reputation: 1105

Azure App Service uses cookies for ARR (Application Request Routing). You have to make sure that your NGinx reverse proxy configuration pass the correct cookie / header to your web app.

The other possibility (to make sure the behavior comes from ARR) is to disable it: https://azure.microsoft.com/en-us/blog/disabling-arrs-instance-affinity-in-windows-azure-web-sites/

Upvotes: 1

Related Questions