Problem configuring Reverse Proxy in SJSWS 7

Hi all,

I was trying to setup reverse proxy on Sun Java System WS 7 for my front-end server to talk to my back-end server application which is /xyz. And I want to access the back-end server app by accessing through my front-end server url. e.g https://aaa.com/xyz

But after configured and try to access the url, I always get this error messageGateway Timeout. Processing of this request was delegated to a server that is not functioning properly.

Below is the obj.conf in my front-end server.

<Object name="default">

AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"

NameTrans fn="ntrans-j2ee" name="j2ee"

NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/webserver7/lib/icons" name="es-internal"

NameTrans fn="map" from="/xyz" name="reverse-proxy-/xyz" to="http:/xyz"

PathCheck fn="uri-clean"

PathCheck fn="check-acl" acl="default"

PathCheck fn="find-pathinfo"

PathCheck fn="find-index-j2ee"

PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"

ObjectType fn="type-j2ee"

ObjectType fn="type-by-extension"

ObjectType fn="force-type" type="text/plain"

Service method="(GET|HEAD)" type="magnus-internal/imagemap" fn="imagemap"

Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"

Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"

Service method="TRACE" fn="service-trace"

Error fn="error-j2ee"

AddLog fn="flex-log"

</Object>

...

...

<Object ppath="http:*">

Service fn="proxy-retrieve" method="*"

</Object>

<Object name="reverse-proxy-/xyz">

Route fn="set-origin-server" server="https://bbb.com:port number"

</Object>

Hope to see some feedback here. Thanks.

[1874 byte] By [unix_beea] at [2007-11-27 11:23:44]
# 1

Can you send error logs?

One reason could be server cert of the web site you are trying to access is not from a trusted CA. For example when I tried I got this in error logs :

[23/Jul/2007:16:44:11] failure (27927): for host .... trying to GET http:/...., service-http reports: HTTP7758: error sending request (SEC_ERROR_UNTRUSTED_ISSUER: Client certificate is signed by an untrusted issuer.)

Inport that server cert's CA certificate into NSSDb's of server.

mva at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

One more thing, in the obj.conf, modify :

1. Modify

NameTrans fn="map" from="/xyz" name="reverse-proxy-/xyz" to="http:/xyz"

to

NameTrans fn="map" from="/xyz" name="reverse-proxy-/" to="/".

2. Modify <Object ppath="http:*"> to <Object ppath="*">

mva at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

Go the the orgin server if it has NSS DB:

>../../bin/certutil -L -d .

My-CA-CertCTu,u,u

Export the certificate :

>../../bin/pk12util -o /tmp/exported.crt -n My-CA-Cert -d .

To import certificate in instances' config directory you have to first initialize the:

>../../bin/certutil -N -d .

Enter Password or Pin for "NSS Certificate DB":

Re-enter password:

Password changed successfully.

Lets say the file /tmp/exported.crt contained the CA cert of the origin server, import that to NSS Db.

> ../../bin/pk12util -i /tmp/exported.crt -d . -v

Enter Password or Pin for "NSS Certificate DB":

Enter password for PKCS12 file:

pk12util: PKCS12 IMPORT SUCCESSFUL

Confirm by listing certs

>../../bin/certutil -L -d .

My-CA-Certu,u,u

You can see that the cert imported doesn't contain CT trust flags.

>../../bin/certutil -M -n My-CA-Cert -t 'CTu,u,u' -d .

Now u can see it is now a proper CA cert

>../../bin/certutil -L -d .

My-CA-CertCTu,u,u

mva at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 4

Correction :

1. Modify

NameTrans fn="map" from="/xyz" name="reverse-proxy-/xyz" to="http:/xyz"

to

NameTrans fn="map" from="/xyz" name="reverse-proxy-/xyz" to="/xyz". (remove the "http:/" thing)

mva at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 5

You don't really need to edit the obj.conf for reverse proxy to work if you have configured the reverse proxy via GUI/CLI.

Install the ca cert as been suggested in one of the previous posts by mv and the reverse proxy should work.

I tried this exercise and it worked for me without any issues.

- Amit

amit-suna at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 6

Hi mv,

Thanks for the kind advise. In terms of the obj.conf, I've done the changes according to your suggestions, but still prompted out the gateway error message. I've already imported the CA cert but to no avail.

I went to check the error log, and I found out this message. Maybe you could enlighten me on this.

[27/Jul/2007:09:54:34] failure ( 2670): for host <ip_address> trying to GET /xyz/, service-http reports: HTTP7758: err

or sending request (SSL_ERROR_BAD_CERT_DOMAIN: Requested domain name does not match the server's certificate.)

Does this mean the server name must be the same with the server-cert subject? Because I noticed the server-cert subject is different with the servers's hostname.

So how should I go on from here?

unix_beea at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 7

Hi Amit,

I've already imported the CA cert into the web server but to no avail. RP still doesn't work.

Still, appreciate your advise.

unix_beea at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...
# 8

unix_bee - No matter what the Subject Name of the origin server's certificate needs to match the name the Reverse proxy thinks its talking to. A mismatch will cause an SSL error for exactly the same reasons that a browser would throw an error if the Subject Name does not match the server name.

JoeMcCabea at 2007-7-29 15:53:23 > top of Java-index,Web & Directory Servers,Web Servers...