Citrix Gateway displays error "HTTP/1.1 504 Gateway Timeout" while connecting to backend resources
book
Article ID: CTX238687
calendar_today
Updated On:
Description
When connecting to the Backend in a Citrix Gateway solution. you could face an issue where the Gateway is sending an error to the client when accessing the backend services/resources.
Analyzing the ADC/Gateway traces you could identify that the Gateway has responded with the error without even initiating the connection to the backend server.
Request:
POST /SecureBrowse/https/gateway.example.com/oauth2/token HTTP/1.1
Host: gateway.example.com:444
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
deviceId: 00000000-0000-0000-0000-000000000000
Cookie: NSC_AAAC=bd27ec1fag5b4937a55abc3a06845b260c3a01d41111111158455e445a4a42
Accept: */*
Connection: keep-alive
Content-Length: 143
User-Agent: SO/1.0 (SecureBrowse; build:1.5; iOS 11.4.0)
Accept-Language: en-US;q=1.0
Authorization: Basic abcWEcsdsWs1I1SFZNTF95UGR1aHZ4a111111111111111111112RveFBEZXVDMlVh
Accept-Encoding: gzip;q=1.0, compress;q=0.5
channel=2&deviceId=00000000-0000-0000-0000-000000000000&grant_type=password&password=Pa$$woRD&scope=openid&subChannel=1&username=mytestuser
Response:
HTTP/1.1 504 Gateway Timeout
Content-Length: 58
Connection: close
Cache-Control: no-cache,no-store
Pragma: no-cache
<html><body><b>Http/1.1 Gateway Timeout</b></body> </html>
Resolution
Below is the solution for the causes:
- If DNS resolution is failing you can test by performing a ping operation on CLI and if the FQDN is not resolved you may add an entry under Traffic Management> DNS> Records> Address Records for the backend server.
- If there are no SNIP or routes are defined which can reach to the backend server the issue may occur, please add routes and SNIP on ADC to be able to connect to the backend.
- If you have "DOWN or Out of Service" services for the backend under Trafic Management> Load Balancing> Services .In the case Gateway will consider the backend as down by default and will not initiate traffic at all. Removing the Services will fix the issue.
Problem Cause
This is a most common issue caused by either of the below
- Gateway/ADC is unable to successfully do a DNS resolution for the backend server.
- Gateway/ADC do not have network connectivity(route/SNIP) to the backend server.
- ADC has some service for the backend, which are marked as DOWN/Out of state.
Issue/Introduction
In a Citrix Gateway solution, when you are trying to connect to the backend application and the connection is failing, in the HTTP response from Gateway you could identify the error as "HTTP/1.1 504 Gateway Timed out"
Was this article helpful?
thumb_up
Yes
thumb_down
No