When a user closes the Web browser on a Macintosh computer using the red X on the Window instead of logging out from the NetScaler Gateway page, the user cannot log on to NetScaler Gateway page again and the HTTP 404 error page appears.
The alternative to use the logout option is to close the Web browser with Command + Q keys on the Macintosh computer.
To resolve this issue, run the following commands from the command line interface of the appliance:
add rewrite action close_conn_act insert_http_header Connection "\"close\""
add rewrite action retry_setclient_act insert_after_all "HTTP.RES.BODY(10000)" q{"<script language=\"javascript\" type=\"text/javascript\">location.replace('/cgi/setclient\?wica');</script>"} -search "text(\"</head>\")"
add rewrite policy conn_close_pol "HTTP.REQ.URL.CONTAINS(\"setclient\?wica\") && HTTP.RES.STATUS.EQ(404)" close_conn_act
add rewrite policy retry_setclient_pol "HTTP.REQ.URL.CONTAINS(\"setclient\?wica\") && HTTP.RES.STATUS.EQ(404)" retry_setclient_act
bind rewrite global conn_close_pol 1 NEXT -type RES_DEFAULT
bind rewrite global retry_setclient_pol 2 end -type RES_DEFAULT
With the preceding configuration, each time an HTTP request is sent to the appliance which contains "setclient?wica" in the URL to which the Web Interface responds with an HTTP 404 error and the appliance adds the "Connection: Close" header to the response before sending it to the client. The appliance also adds some Java script which makes the client immediately reload the same page.
The client browser then opens a new TCP connection for this request because it cannot reuse the old TCP connection with the new cookie because of the “Connection: Close” header.
The following is the list of events that occur in the scenario when the error appears: