WebServer 6.0 - changing 502 to 402

I am using iPlanet web server 6.0 set up as a passthrough to SunOne App server running on the same host.

My problem is that when a non existing document is requested the app server attempts to find it but it does not and it returns a 402 error, this results in the web server returning a 502 error to the web client.

What is the best way to fix this situation so that the web client sees 402 not 502.... ?

[425 byte] By [Steve_Bancrofta] at [2007-11-27 1:32:48]
# 1

iPlanet Web Server doesn't rewrite 402 responses to 502 responses. If you're getting a 502 response, that must mean that the plugin told Web Server to send a 502 response.

A 502 Bad Gateway response is returned by proxies and gateways to indicate that an upstream server returned an invalid response. Since Web Server 6.0 has no built-in proxy or gateway functionality, Web Server 6.0 itself will never generate such responses.

What plugin are you using to communicate with the Application Server? Have you confirmed that the Application Server is returning a 402 Payment Required response? (Note that 402 Payment Required is an extremely uncommon HTTP status code. Perhaps you meant 404 Not Found?)

elvinga at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Oh yes sorry my bad, the App server is replying with a 404, eg from the app server logs: "GET /fred.htm HTTP/1.1" 404This then becomes a 502 returned to the web client from the web server.

Here is the passthrough config, does this help ?

<Object name="passthrough">

ObjectType fn="force-type" type="magnus-internal/passthrough"

Service type="magnus-internal/passthrough" fn="service-passthrough" servers="http://xxx.xxx.xxx:yyy"

Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"

</Object>

Steve_Bancrofta at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...
# 3
Hi,502 is for bad gateway, you will get it when the plugin is not working fine. if a doc is not available on app server it will give you 404.
activexperta at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...
# 4
...and which plugin is this? It must have a name and version number.
elvinga at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...
# 5

Plugin is the one which is connecting your webserver to app server.

See if you have any errors in the startup log (server.log) of the web server for lbplugin. Is the DOCROOT of web and app servers is same or different?

If you want you can keep the custom error pages from the web server admin GUI by using the custom error responses, available in content management.

activexperta at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...
# 6

Don't see any errors in the web server startup log for lbplugin.

I realise I can customise the error pages but that will not help. Since the 502 error that is returned is embedded in the header, hence google is caching pages that it thinks are only temporarily unavailable, when infact the header should be 404, this will clear it from the google cache, changing the content of the error page will not correct this.

The app server and web server docroot are different.

Steve_Bancrofta at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...
# 7
pls post the web and app server log portion by hitting an unavailable file.say try for test.html from webserver, catch the log portion for that request from webserver and app server as well.
activexperta at 2007-7-12 0:37:51 > top of Java-index,Web & Directory Servers,Web Servers...