Running a Spring Boot app behind nginx

后端 未结 1 802
囚心锁ツ
囚心锁ツ 2021-02-20 06:45

I have a Spring Boot + MVC app up and running on my server and it\'s bound to http://localhost:8000.

There is an nginx proxy (or is it a reverse proxy, not

1条回答
  •  醉梦人生
    2021-02-20 07:11

    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.

    0 讨论(0)
提交回复
热议问题