Reputation: 367
My applications is spring based and served by jetty. The current setup looks like this.
Apache - > Reverse proxy -> Embedded Jetty -> Application
When I access the app directly (http://127.0.0.1:15000) without reverse proxy the static resources are loaded (css, .js etc) but if I access it through reverse proxy (https://127.0.0.1/app/) it doesn't work.
Here are my configs.
apache2.conf
ProxyPass /app/ http://127.0.0.1:15000/
ProxyPassReverse /app/ http://127.0.0.1:15000/
SSLProxyEngine on
RewriteEngine On
RewriteRule /app$ /app/ [R]
spring-servlet.xml
...
<mvc:default-servlet-handler />
<mvc:resources mapping="/resources/**" location="/resources/" />
...
I would like that in both ways the static content will be delivered.
Upvotes: 1
Views: 1583
Reputation: 3666
I know this is too late. But for anyone who might end up here, Adding a mapping to your resources path will solve the problem.
ProxyPass /app/resources http://127.0.0.1:15000/app/resources
ProxyPassReverse /app/resources http://127.0.0.1:15000/app/resources
This should be added before your existing mapping.(longest URL comes first, as whichever mapping is read first, wins)
Upvotes: 2