I'm trying to configure nginx to proxy wss for vaadin using tomcat as the server.
Here is my current configuration:
location / {
#try_files $uri $uri/ =404;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_pass http://tomcat/mycontext/;
proxy_read_timeout 300;
# wss
proxy_set_header Connection $http_connection;
proxy_set_header Connection "upgrade";
}
location /mycontext/ {
#try_files $uri $uri/ =404;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_pass http://tomcat/mycontext/;
proxy_read_timeout 300;
# wss
proxy_set_header Connection $http_connection;
proxy_set_header Connection "upgrade";
}
upstream
upstream tomcat {
server localhost:8080 fail_timeout=0;
}
nginx starts without complaint and works for HTTP without the two lines after the #wss comment.
When I try to connect to vaadin I get the error:
Error in WebSocket connection to wss://myapp.dev/ui/?v-r=push&debug_window
If it makes a difference we are using atmosphere for wss.