tomcat - Nginx 背后的 Tomcat 上的应用程序

标签 tomcat nginx forwarding

我的应用程序在 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/

相关文章:

nginx - 如何使用 Nginx 重写将 url 段转换为查询字符串

c++ - 将 Kamailio SIP 消息转发到 C 应用程序

tomcat - 在 Tomcat 中将 unpackWAR 设置为 false 时会发生什么

asp.net - 带有 SSL 和 Asp.NET Core API 的 Nginx 反向代理

nginx - 如何使用 php-fpm 和 nginx 设置特定 IP 地址的内存限制和执行超时?

php - 转发 Zend_Mail_Message

linux - iptables 端口转发到网络服务器通过 vpn 连接而不安装 nginx

java - 没有任何根本原因的 IllegalStateException

java - 如何在 Junit 中使用嵌入式 Tomcat 7 测试基于 servlet 3.0 注释的 servlet

web-services - @Resource private WebServiceContext 上下文给出空值