Running a Spring Boot app behind nginx Running a Spring Boot app behind nginx nginx nginx

Running a Spring Boot app behind nginx


You can't combine proxy_pass with try_files in the way that you have attempted. As the comment in your configuration describes, the try_files directive causes nginx to look for a file that matches the URI and then look for a directory that matches the URI. If it doesn't find either, it responds with a 404. You can read more about try_files in the nginx documentation.

It's not clear from your question that you need to use try_files at all so the simplest way to fix your configuration is to remove the try_files line.