Vaadin 7 and Apache ProxyPass

Hi!
I am trying to make my Vaadin 7 application work using an Apache Proxy. The Vaadin 7 Release Notes say:
Adds support for Apache ProxyPass and other similar proxies
. But I can’t find any tutorial on how to do this.

Assume I have the following configuration:

  • The web page my Vaadin application is embedded ist hosted on http
    s
    ://www.mydomain.com
    /page
    (via Apache).
  • The Vaadin application is hosted on http://www.mydomain.com
    :8080/vaadinapp
    (via Jetty).
  • The diplay-name (configured in web.xml) is
    myapp
    .

With
Vaadin 6
the following apache directives were sufficient to make all work:


ProxyPass /vaadinapp/VAADIN/ http://www.mydomain.com:8080/vaadinapp/VAADIN/
ProxyPass /vaadinapp/myapp/ http://www.mydomain.com:8080/vaadinapp/
ProxyPassReverse /vaadinapp/VAADIN/ http://www.mydomain.com:8080/vaadinapp/VAADIN/
ProxyPassReverse /vaadinapp/myapp/ http://www.mydomain.com:8080/vaadinapp/
ProxyPreserveHost on
RequestHeader set X-Forwarded-Proto "https"

With
Vaadin 7
the application will show the first screen but any further communication won’t work.

How can I get this to work?

Maybe the code of the embedding page is also interesting:

Vaadin 6:


...
<script type="text/javascript">
        var vaadin = {
          vaadinConfigurations: {
            email: {
              appUri:'/vaadinapp/myapp',
		windowName:'My Vaadin App',
              pathInfo: '/',
              themeUri:'/vaadinapp/VAADIN/themes/mytheme',
              versionInfo : {}}
          }};
      </script>
...


Vaadin 7:


...
<script type="text/javascript"
          src="/vaadinapp/VAADIN/vaadinBootstrap.js"></script>
<script type="text/javascript">//<![CDATA[
    if (!window.vaadin)
        alert("Failed to load the bootstrap JavaScript: "+
              "/vaadinapp/VAADIN/vaadinBootstrap.js");

    /* The UI Configuration */
	vaadin.initApplication("vaadinapp", {
	    "browserDetailsUrl": "/vaadinapp/myapp",
	    "widgetset": "com.vaadin.DefaultWidgetSet",
	    "theme": "mytheme",
	    "versionInfo": {"vaadinVersion": "7.0.0"},
	    "vaadinDir": "/vaadinapp/VAADIN/",
	    "heartbeatInterval": 300,
	    "debug": true,
	    "standalone": false,
	    "authErrMsg": {
	        "message": "Take note of any unsaved data, "+
	                   "and <u>click here<\/u> to continue.",
	        "caption": "Authentication problem"
	    },
	    "comErrMsg": {
	        "message": "Take note of any unsaved data, "+
	                   "and <u>click here<\/u> to continue.",
	        "caption": "Communication problem"
	    },
	    "sessExpMsg": {
	        "message": "Take note of any unsaved data, "+
	                   "and <u>click here<\/u> to continue.",
	        "caption": "Session Expired"
	    }
	 });//]] >
	 </script>
...

I have the same problem, did you manage to resolve this?

I just get the first screen, then any further action results in a big red error message saying “Cookies Disabled”.

Any ideas?

I managed to get this working, but only by using the same app context. I really wanted to redirect from a root hostname to my tomcat instance. I suppose I could make my app the default app in that instance instead and then update the context paths.

I just set up a reverse Apache proxy for automated testing yesterday using

    <LocationMatch "/demo/">
        ProxyPass           http://127.0.0.1:1234/realdemo/
        ProxyPassReverse    http://127.0.0.1:1234/realdemo/
        ProxyPassReverseCookiePath /realdemo /demo
    </LocationMatch>

The CookiePath parameter is necessary to rewrite the path in the session cookie so the browser sends it back with the next request

Artur Signell:
I just set up a reverse Apache proxy for automated testing yesterday using

<LocationMatch "/demo/">
        ProxyPass           http://127.0.0.1:1234/realdemo/
        ProxyPassReverse    http://127.0.0.1:1234/realdemo/
        ProxyPassReverseCookiePath /realdemo /demo
    </LocationMatch>

The CookiePath parameter is necessary to rewrite the path in the session cookie so the browser sends it back with the next request

Thank this answer.

Artur Signell:
I just set up a reverse Apache proxy for automated testing yesterday using

<LocationMatch "/demo/">
        ProxyPass           http://127.0.0.1:1234/realdemo/
        ProxyPassReverse    http://127.0.0.1:1234/realdemo/
        ProxyPassReverseCookiePath /realdemo /demo
    </LocationMatch>

The CookiePath parameter is necessary to rewrite the path in the session cookie so the browser sends it back with the next request

Thank you.