Spring Boot with embedded Tomcat behind Apache proxy

前端 未结 7 1386
暖寄归人
暖寄归人 2020-12-08 09:51

We have a Spring Boot (Spring MVC) app with embedded Tomcat on a dedicated appserver behind an Apache SSL proxy.

The SSL port on the proxy server is 4433, forwarding

7条回答
  •  甜味超标
    2020-12-08 10:37

    Try setting the Rewrite rule like: https://proxyserver:4433/appname >>forward>> http://appserver:8080/appname

    And then set your application context to "appname" server.context-path=/appname

    So locally you can run by http://appserver:8080/appname and via Reverse Proxy you access via https://proxyserver:4433/appname

    Since I am using JBOSS, changes in standalone.xm of jboss:

    
    

    Tomcat would have similar config, to inform Tomcat (proxy-address-forwarding="true") to respect the proxy forwarding address.

提交回复
热议问题