I have setup NGINX as load balancer for our 4 server IIS webservers. All 4 servers use the same code. However one of the webservers will return an error when in the load balancer array.
SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: element '<ellement>' already defined in <test php file>
To test this we created a small php script (see below) and random we get this error.
What has been tested:
When in array with other 3 servers: sometimes an error
When in array with just 2 other servers: Always an error
Direct connection to the server (hosts file): no error
Load balancer array only this one server: no errors
Load balancer array with all but this server: no errors
This is our nginx.conf:
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
upstream backend {
server 192.168.100.87 max_fails=3 fail_timeout=30s;
server 192.168.100.187 max_fails=3 fail_timeout=30s;
server 192.168.100.197 max_fails=3 fail_timeout=30s;
# server 192.168.100.198 max_fails=3 fail_timeout=30s;
}
server {
listen 80;
listen 443 ssl;
server_name <domain>.com;
ssl_certificate /etc/ssl/private/<domain>_com.pem;
ssl_certificate_key /etc/ssl/private/<domain>_com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
}
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 75;
client_header_timeout 3000;
client_body_timeout 3000;
proxy_read_timeout 6000;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Test.php
<?php
for ($x = 0; $x <= 10; $x++) {
echo "The number is: $x <br>";
try
{
$wsdl = 'http://domain.com/Corporate/Product.svc?wsdl';
$client = new SoapClient($wsdl, array("trace" => 1));
}
catch (Exception $e)
{
echo $e;
echo "<br>";
}
}
?>
Can anybody help me out here? I am at a loss.
Thanks for reading.
SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: element '<ellement>' already defined in <test php file>
To test this we created a small php script (see below) and random we get this error.
What has been tested:
When in array with other 3 servers: sometimes an error
When in array with just 2 other servers: Always an error
Direct connection to the server (hosts file): no error
Load balancer array only this one server: no errors
Load balancer array with all but this server: no errors
This is our nginx.conf:
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
upstream backend {
server 192.168.100.87 max_fails=3 fail_timeout=30s;
server 192.168.100.187 max_fails=3 fail_timeout=30s;
server 192.168.100.197 max_fails=3 fail_timeout=30s;
# server 192.168.100.198 max_fails=3 fail_timeout=30s;
}
server {
listen 80;
listen 443 ssl;
server_name <domain>.com;
ssl_certificate /etc/ssl/private/<domain>_com.pem;
ssl_certificate_key /etc/ssl/private/<domain>_com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
}
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" $request_time';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 75;
client_header_timeout 3000;
client_body_timeout 3000;
proxy_read_timeout 6000;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Test.php
<?php
for ($x = 0; $x <= 10; $x++) {
echo "The number is: $x <br>";
try
{
$wsdl = 'http://domain.com/Corporate/Product.svc?wsdl';
$client = new SoapClient($wsdl, array("trace" => 1));
}
catch (Exception $e)
{
echo $e;
echo "<br>";
}
}
?>
Can anybody help me out here? I am at a loss.
Thanks for reading.