Reverse proxy plugin not working

Hi,

I have just migrated my site from Sun One web server 6.0 to Sun Java Web Server 6.1 SP5, and installed the reverse proxy plug-in on it.

I want to use the reverse proxy plug-in to hide the redirection to server that is running Apache, from the users.

I configured the magnus.obj with adding the following line at the end of the document:

Init fn=攍oad-modules?shlib=擟:/Sun/WebServer6.1/plugins/reverseproxy/passthrough.dll?

funcs="init-passthrough,auth-passthrough,check-passthrough,service-passthrough" NativeThread="no"

And added the following to the beginning of the obj.conf:

<Object name=攙aultserver?gt;

ObjectType fn=攆orce-type?type=攎agnus-internal/passthrough?Service type=攎agnus-internal/passthrough?fn=攕ervice-passthrough?servers="http://myfileserver"

</object>

<object name=攄efault?gt;

NameTrans fn=攁ssign-name?from=?vault|/vault/*?name=攙aultserver?

But when I try to access the files in the file server with the http://mywebsite/vault/myfiles.pdf it gives me this error in the log file:

Trying to GET /Vault/myfile.pdf, send-reports:

HTTP4142: can抰 find C:/iPlanet/Servers/docs/Vault/myfile.pdf (File not found)

The C:/iPlanet/Servers/docs/ is the docroot for my web-site. Why does it look for the files in that location? If I enter the URL of the file server (http://fileserver/myfiles.pdf) it gives me the file without any problem. I tried all the options of the setting that I find in the documentation and on-line but I end up with the same error every time. Can anyone tell me what am I doing wrong?

Regards,

Lena

[1769 byte] By [Lena] at [2007-11-26 10:22:33]
# 1

The server looks for files in the document root unless you tell it to look elsewhere. If it's looking for /Vault/myfile.pdf in the document root, that means you haven't told it to look elsewhere for /Vault/myfile.pdf. The problem is that the "/vault|/vault/*" wildcard pattern doesn't do what you want. Instead, you probably want "(/vault|/vault/*)" or "/vault(|/*)".

The Reverse Proxy Plugin release notes have some information on correctly configuring the plugin: http://docs.sun.com/app/docs/doc/819-6510/6n8h5jos2?a=view

The syntax of wildcard patterns is described in the NSAPI Programmer's Guide: http://docs.sun.com/app/docs/doc/819-6515/6n8hacbqk?a=view

elving at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 2

Thank you very much for your reply.

As I mentioned earlier I have tried the settings as suggested in those documents, examples 1 and 2 - they gave the same error.

Then I tried couple of other things that I found in the postings on this forum and on other web-sites, but still no luck.

This was the last setting that I tried and gave the same error. But, thanks for that wildcard patterns description link.

Now I found the following posting that got the same error

http://forum.sun.com/jive/thread.jspa?forumID=16&threadID=54742

, and I used the solution mentioned there - added the Service method=(GET|HEAD) type="*/*" fn="service-passthrough" servers="http://<targetIP>"

in my obj.conf and it works. Are there some known vulnerabilities associated with this solution?

And there is a little something that is bugging me: when I access the files on the file server the URL is translated in /Vault (capital letter V). Since my file server is Apache running on Linux, it doesn't recognize it. Is there a way of configuring the web server not to translate it in a starting capital letter?

Regards,

Lena

Lena at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 3

No, no vulnerabilities, but it's a strange thing to do. Specifying type="*/*" is effectively equivalent to omitting the type parameter altogether. (However, it shouldn't be necessary to change the type parameter. The sole problem in your example was the improper wildcard pattern.)

As for /Vault vs. /vault, I'm not sure what you mean by "configuring the web server not to translate ". If the client (web browser) asks for /vault, the Reverse Proxy Plugin will make a request for /vault. If the client asks for /Vault, the Reverse Proxy Plugin will make a request for /Vault. Niether Web Server nor the Reverse Proxy Plugin will arbitrarily decide to uppercase a letter in a URI.

elving at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 4
Thank you for your reply.It stopped me from going on a wild goose chase and pointed me to looking in my code ?where I found my stupid typing mistake.
Lena at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 5
Hi,Even I'm trying to consigure SUNOne web server with proxy plugin to handle backend server redirects. Does anyone know the syntax to re-write the urls to replace backend hots:port with proy host:portAny pointers will be helpful.Tx. Amol.
Future@IDM at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 6

Re: Reverse Proxy Redirection Problem

Nov 25, 2006 10:58 PM (reply 10 of 10)

Hi Lina,

Good Morning. Please calrify the below issue about reverse proxy. ( The redirection is not happening from WebServer to AppServer)

- I have installed the one WebServer with below configuration.

- Installed Sun ONE Web Server 6.1SP6 with Sun ONE Web Server 6.1SP3 Reverse Proxy Plugin.

- This is my obj.conf file:

NameTrans fn="assign-name" from="/wps" name="passthrough1"

.

.

.

<Object name="passthrough1">

Service type="magnus-internal/passthrough"

fn="service-passthrough"

servers="http://<AppServer>:9081/wps/"

</Object>

- This is magnus.conf file:

Init fn=flex-init access="$accesslog" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"

Init fn="load-modules" shlib="/opt/SUNWwbsvr/bin/https/lib/libj2eeplugin.so" shlib_flags="(global|now)"

Init fn="load-modules" shlib="/opt/SUNWwbsvr/plugins/passthrough/libpassthrough.so"

When I am trying to access the WebServer URL http://<WebServer>:<port>/wps/ is not redirting to AppServer URL i.e (http://<AppServer>:9081/wps/).

- Please find the log file as below :-

[26/Nov/2006:10:52:11] warning ( 5727): for host 172.16.5.63 trying to GET /wps/, send-file reports: HTTP4142: can't find /opt/SUNWwbsvr/docs/wps/ (File not found)

- I am confusing it searching the "wps" directory under the doc root directory.

Kindly help to suggest me to resolve the issue.

Thanks a lot in advance.

Best Regards

Elayaraja.K

ChennaiRaja at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 7

Hi Elayaraja,

In the obj.conf I put the

<Object name="passthrough1">

Service type="magnus-internal/passthrough"

fn="service-passthrough"

servers="http://<AppServer>:9081/wps/"

</Object>

at the top of the file, followed by the definition for the default object in which I placed the name translation at the begining:

<Object name="default">

NameTrans fn="assign-name" from="/wps" name="passthrough1"

And then I placed the

Service method=(GET|HEAD) type="*/*" fn="service-passthrough" servers="http://<targetIP>"

definition in the default object after all the existing Service method definitions.

Regards,

Lena

Lena at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...
# 8
Hi Leny,Thanks a lot for the help... Now it's working fine..Please let me know your mail id .Best Regards,Elayaraja.K
SKE at 2007-7-7 2:22:59 > top of Java-index,Web & Directory Servers,Web Servers...