Hello, i hope this finds you well.
I am trying to deploy my vaadin application on tomcat on a custom context path.
Let us consider the following hypothesis:
website name: foo.com
tomcat context path name: /this/path
Whenever i try to access the web after adding reverse proxy on foo.com to let me access /this/path (with out actually redirecting the url), it always redirects me to foo.com/this/path and i get the following error
This page isn’t working foo.com redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS
The following is my nginx config:
upstream website {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
#listen 80;
server_name foo.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://website/this/path/; <- (if i remove the last slash i get a 404)
proxy_read_timeout 90;
proxy_http_version 1.1;
proxy_request_buffering off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/foo.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/foo.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.foo.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.foo.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.foo.com;
return 404; # managed by Certbot
}
Now my vaadin application, indeed runs with spring boot.
I did try to change the context path from applciation.properties as suggested here [Vaadin Spring Configuration]
(https://vaadin.com/docs/v14/flow/spring/tutorial-spring-configuration.html) But with no luck.
Note that a normal spring boot applciation was configured successfully with the above configuration.
Regards.
Thank you for any support or help.