We are currently using HTTPD server (apache) to handle client request. The requests are further proxied to a Application Server (glassfish) which provides the content. The content are static files (software images). Below is the ProxyPass directive used.
ProxyPass /access/sw http://localhost:8080/access/sw
We would like Apache to handle static contents as its frees up the glassfish to do other jobs. The only issue with this is the request still needs to be directed to the glassfish to check for business logic. The glassfish server after running the business logic should send a response back to Apache confirming that the client is allowed to download the software image. It can also send a negative reponse back to Apache to reject the clients request.
How can this be achived? Are there any apache modules to handle this? Just to reiterate, is the below achieveable?
Request from client -> Apache -> Glassfish (runs the business logic) -> responds back to Apache if client should be allowed to download -> Apache serves the static file depending on glassfish response
P.S - Client cannot handle redirect requests. Client sends a single GET