1

This is my current nginx config which works the way I want.

server {
    listen 443 ssl;
    server_name subdomain.domain.com;

    ssl_certificate /etc/ssl/domain.pem;
    ssl_certificate_key /etc/ssl/domain.key;

    location /domain-folder1 {
        proxy_pass http://127.0.0.1:5678/;
        include proxy_params;
    }
    location /domain-folder2 {
        proxy_pass http://127.0.0.1:4151/;
        include proxy_params;
    }
}

I tried to setup the Application Gateway with the same logic as nginx but nothing worked so far.

I thought Path based rules should work but they dont.

Fynenix
  • 11
  • 2

1 Answers1

0

I created sample nginx proxy and setup to Azure application gateway.

enter image description here

To setup the Application Gateway with the same as nginx, created application gateway added backend pool as defined in the servers or endpoints to which the requests will be forwarded for each of your backend services.

enter image description here

Add routing rule and backend setting, you can create a listener for port 443 and associate the appropriate SSL certificate. Specify the server name to match the host header in the incoming requests.

enter image description here

enter image description here

Add health probe to configure correct custom domain name as its host name like below:

In host add name of virtual host running on the application gateway server

enter image description here

Verify backend health of web application are in healthy state, it redirects with server successfully like below:

enter image description here

enter image description here

To know more in detail, check the below references:

Using Microsoft Azure Load Balancers and NGINX Plus

Azure-docs/articles/application-gateway/configuration-request-routing-rules MicrosoftDocs/azure-docs ยท GitHub

Imran
  • 3,875
  • 2
  • 3
  • 12