"502 bad gateway" response with L7 transparent mode
search cancel

"502 bad gateway" response with L7 transparent mode

book

Article ID: 336810

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

Symptoms:
1. Clients receive 502 bad gateway response
2. In the edge syslog, we see "99: Cannot assign requested address" errors

Environment

VMware NSX

Cause

This is a timing issue.

With only "l7 transparent mode", the LB will use the same client IP and port to connect to the selected backend server for each http request comes from that client connection. There's a chance that 2 http requests from the same connection are allocated to the same backend server, which triggers connections to that server with the same IP and port. If the previous connection still exists or is not fully closed, 99 error is reported with "cannot assign the address", and then 502 response is returned.

Resolution

Workaround:
Option 1:
- Enable Server Keep-Alive on the application profile assigned to the virtual server.

Option 2:
- Enable SNAT by configuring “SNAT Translation Mode” to “Automap” or “IP Pool” based on the requirement.
- Use x-forwarded-for if client IP needs to be visible to backend devices.