Issue Proxying .NET application after POST

Topics: User Forum
Aug 8, 2014 at 9:08 PM
Edited Aug 8, 2014 at 9:09 PM
Hey all,

Been wrapping my head around this issue I have. I am hoping someone can help answer.

My client-facing URL is as follows: http://publicsite.com/subsite/app
I have an application that is located here: http://backend/app. The application does NOT have hardcoded paths, it's all relative.

I want to proxy the publicsite.com/subsite/app to http://backend/app. I have successfully done this using both RewriteRule and ProxyPass, however..

When I submit the form for the app, it tries to redirect to http://publicsite.com/app, and NOT http://publicsite.com/subsite/app.

Also, when loading resources such as images, css, etc, it is looking for them on http://publicsite.com/app and not http://publicsite.com/subsite/app.

Basically, what I want is when someone submits the form on /subsite/app, that the response that comes back is written in the URL field as /subsite/app/XXX instead of /app (which doesn't exist on my publicsite.com)

I hope I am being clear. I have played with ProxyPass, ProxyPassReverse and can't seem to get this going. If I add a RewriteRule /app(.*) http://backend/app/$1 then it will work, but the visible URL in the address bar is not what I want to show.

So in sum:

Public URL: http://publicsite.com/subsite/app
Backend URL: http://backend/app

When submitting the form on the public URL, the response from that form goes to http://publicsite.com/app instead of http://publicsite/subsite/app. Also, all resources (css, images) are trying to be pulled from http://publicsite.com/app instead of http://publicsite.com/subsite/app/

How can I get around this?