Wednesday, February 11, 2015

Reason and solution for not loading WSDL in a clustered setup fronted by NGINX

For more information about nginx http proxy module please refer :

Issue :
Sometimes a WSDL in a clustered setup fronted by NGINX might not be loaded.

Reason :

By default, http version 1.0 is used in nginx. Version 1.1 is recommended for use with keepalive connections. Therefore sometimes the wsdl will not be loaded.

You can confirm it by doing a curl command to the wsdl ngingx url.

E.g.,  curl
Then you will get half of the wsdl.

Solution :

To avoid this, you will have to configure the nginx configuration file to set it's http version.

       proxy_http_version 1.1;

Example :

As an example,

      listen 8280;

location / {
       proxy_set_header X-Forwarded-Host $host;
       proxy_set_header X-Forwarded-Server $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

       proxy_http_version 1.1;

        proxy_pass http://esbworkers;
        proxy_redirect http://esbworkers;


This configuration is applicable for nginx versions above 1.1.4