Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin 7.x and nginx reverse proxy

Peter Sauer
7 years ago Nov 15, 2015 6:53pm
Pekka Hyvönen
7 years ago Nov 16, 2015 8:40am
richard gunn
7 years ago Dec 15, 2015 4:30am

You need to proxy all PUSH calls in your nginx setup. We are using nginx to proxy 443 connections to tomcat on 8080 for multiple virtual tomcat domains. This is an example of an nginx site config

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;

server {
  server_name x.y.com;
  listen 443;
  ssl on;
  ssl_certificate /opt/tomcat/ssl/cert.pem;
  ssl_certificate_key /opt/tomcat/ssl/cert.key;
  root /opt/tomcat/appname;

  location / {
    # Forward SSL so that Tomcat knows what to do
    proxy_pass http://x.y.com:8080;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;

  location /PUSH {
        proxy_pass http://x.y.com:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;



Tomáš Bambas
6 years ago Sep 28, 2016 6:21pm
Tomáš Bambas
6 years ago Oct 03, 2016 8:09pm
Giacomo Arru
5 years ago Mar 08, 2018 2:08pm
Giacomo Arru
4 years ago Jul 16, 2018 1:23pm