我的应用程序在 Nginx 后面的 8080 端口上的 Tomcat 上运行。我一直在关注 digitalocean 从此页面设置我的 tomcat 和 nginx setting tomcat behind nginx
我在 Tomcat 上部署了我的“myapp”。我可以在 http://floatingip/myapp/ 访问它(没有显示图像)但是当我深入到 myapp 路径下方时,比如“myapp/login”路径,我得到了 404。
在过去,我曾为其他东西尝试过类似的方法:
location / {
#put in by me
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_pass http://127.0.0.1:8080/;
}
nginx 中的每个应用程序都需要类似的东西吗?
谢谢
最佳答案
我确实尝试了我在“location/”上张贴的内容,它起作用了,但图像没有显示在页面上。没什么大不了的,但我想找出我缺少什么来显示 jpeg 文件。
关于tomcat - Nginx 背后的 Tomcat 上的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39375896/