Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] ProxyServlet https redirect issue

I think I found something that works... 
http://wiki.eclipse.org/Jetty/Tutorial/Apache#Proxying_SSL_on_Apache_to_HTTP_on_Jetty

It however breaks the application if I try to access it directly on the jetty server. Is there a less "harsh" (more standard) way to achieve this? 

Pavel


On Thu, Sep 16, 2010 at 2:00 PM, Pavel Jbanov <pavel.jbanov@xxxxxxxxx> wrote:
Hi,

I'm have a problem with redirects when requests go through a ProxyServlet configured on HTTPS, proxying for an HTTP backend. The problem is that when the application sends a redirect, the URL schema is reset from HTTPS to HTTP. Ex:

a.jsp:
<%
String redirectURL = request.getContextPath() + "/b.jsp";
response.sendRedirect(redirectURL);
%>

b.jsp:
Hello World!

The app is running on Jetty and configured with SelectChannelConnector on port 8086. The transparent proxy is configured like this:
Prefix: /

SslSelectChannelConnector for the proxy is configured on port 443.

So, when I go to https://proxy-server/MyApp/a.jsp it is redirected to http://proxy-server/MyApp/b.jsp which breaks. Accessing https://proxy-server/MyApp/b.jsp directly works fine.

I checked the response header: Location: http://proxy-server/MyApp/b.jsp

How can I set up the proxy or the backend so that the HTTPS schema is preserved on redirects?

(I'm using Jetty 7.1.6.v20100715 both on proxy and the backend server.)

Thank you,

Pavel


Back to the top