Skip to Content
0
Sep 20, 2007 at 06:43 AM

Apache as reverse proxy - 400 Bad request

2374 Views

Hi all,

I'm configured apache as reverse proxy according to this blog:

The Reverse Proxy Series -- Part 3: Apache as a reverse-proxy

When I try to navigate http://testcomp/irj I get "400 - Bad request"

See exception;

<i>Message : User Guest, IP address

Cannot parse the http request. Http error response [400 Bad Request] will be returned. Request is [Host: sapportal:50000

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, /

Accept-Language: en,he;q=0.5

Accept-Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; FDM; .NET CLR 2.0.50727)

Max-Forwards: 10

Via: 1.1 localhost

X-Forwarded-For: 10.0.0.4

X-Forwarded-Host: 10.0.0.6

X-Forwarded-Server: localhost

Connection: Keep-Alive

GET /irj HTTP/1.1

Host: sapportal:50000

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, /

Accept-Language: en,he;q=0.5

Accept-Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; FDM; .NET CLR 2.0.50727)

Max-Forwards: 10

Via: 1.1 localhost

X-Forwarded-For: 10.0.0.4

X-Forwarded-Host: 10.0.0.6

X-Forwarded-Server: localhost

Connection: Keep-Alive

].

com.sap.engine.services.httpserver.exceptions.HttpIllegalArgumentException: Incompatible field content in the MIME header.

at com.sap.engine.services.httpserver.lib.headers.MimeHeaderField.parse(MimeHeaderField.java:364)

at com.sap.engine.services.httpserver.lib.headers.MimeHeaders.init(MimeHeaders.java:504)

at com.sap.engine.services.httpserver.server.RequestAnalizer.initialize(RequestAnalizer.java:196)

at com.sap.engine.services.httpserver.server.Client.initialize(Client.java:84)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:143)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

Severity : Error

Category :

Location : com.sap.engine.services.httpserver

Application :

Thread : SAPEngine_Application_Thread[impl:3]_32

Datasource : 9332850:C:usrsapPD9JC00j2eeclusterserver0logdefaultTrace.trc

Message ID : 000C29EFE9A300570000002D00000B9000043A81D3311894

Source Name : com.sap.engine.services.httpserver

Argument Objs :

Arguments :

Dsr Component :

Dsr Transaction : 5359e85066e411dcbf6b000c29efe9a3

Dsr User :

Indent : 0

Level : 0

Message Code :

Message Type : 0

Relatives :

Resource Bundlename :

Session : 2

Source : com.sap.engine.services.httpserver

ThreadObject : SAPEngine_Application_Thread[impl:3]_32

Transaction :

User : Guest</i>

The lines I added to http.conf

<i>#Enable reverse-proxying

ProxyVia on

ProxyTimeout 600

#disable forward-proxying

ProxyRequests Off

#proxy /irj both ways

ProxyPass /irj http://sapportal:50000/irj

ProxyPassReverse /irj http://testcomp/irj

#proxy /logon both ways

ProxyPass /logon http://sapportal:50000/logon

ProxyPassReverse /logon http://testcomp/logon</i>

I tried with apache version 2.2.3 & 2.0.59 with no success.

My J2EE/Portal version is 6.17.

Since this is a testing environment the two computers are under the same workgroup (no domain).

If I naviagte directly to the portal (without the reverse proxy) everything is working.

How can I solve it?

Regards,

Omri