Thursday, July 9, 2015

Re: GWT app doesn't work behind reverse proxy

Something else you can do to handle the RPC portion of the issue in the servlet is to do:

@Override
    protected SerializationPolicy doGetSerializationPolicy(
            HttpServletRequest request, String moduleBaseURL, String strongName) {
        moduleBaseURL = request.getScheme() + "://" + request.getServerName()
                + (new File(request.getRequestURI()).getParent() + "/");
        return super.doGetSerializationPolicy(request, moduleBaseURL,
                strongName);
    }

On 07/09/2015 10:16 AM, dhoffer wrote:
We have a GWT app using (2.6.1) that is deployed to Tomcat and has been working fine, recently Tomcat's FORM container authentication was added and that too was working well.  The problem is now we want to put the app/Tomcat behind an Apache reverse proxy so end users get a nice URL and this is breaking the app.  First it breaks Tomcat's FORM authentication, we now get 408 errors when trying to log into the app.  As a test we took out the authentication and found that the client side UI works fine but all calls to the server fail, e.g. all RPC calls fail too.  This later problem seems similar/same as what is described here http://stackoverflow.com/questions/1517290/problem-with-gwt-behind-a-reverse-proxy-either-nginx-or-apache

What is the solution here?  I could try the approach in the link above but that only addresses the GWT part, I need that and authentication.  Putting the app behind a reverse proxy seems such a common thing to do it seems we are missing something here that will fix both issues.


No comments:

Post a Comment