Hi,
I have a rails application that is set up to cache pages for certain URLs for lsws to serve (when they exist) without hitting the rails application. Most of these URLs represent RESTful rails resource (i.e. using map.resource in routes.rb and restful controller implementations). An example resource is a feed url like /v1/feeds/1.app. GET the url and rails generates a cached version.
My problem is that while the resource URL is cached correctly, whenever I try to subsequently POST (create a new resource), PUT (update the resource) or DELETE (delete a resource), lwsw always returns a 405 "Method Not Allowed" response.
I suspect lsws thinks that since the static file exists on disk, it should refuse the request instead of dispatching it to the rails application. Is there any way to stop litespeed from returning the 405?
I have looked at using rewrite to fudge it, and while I can write a condition like
#RewriteCond %{REQUEST_METHOD} ^(POST|DELETE|PUT)$
to detect the incoming request is not a GET, I'm not sure what I can write the subsequent RewriteRule as in order to stop lsws from finding the cached page and instead dispatch to the rails application.
Any suggestions?
John.
I have a rails application that is set up to cache pages for certain URLs for lsws to serve (when they exist) without hitting the rails application. Most of these URLs represent RESTful rails resource (i.e. using map.resource in routes.rb and restful controller implementations). An example resource is a feed url like /v1/feeds/1.app. GET the url and rails generates a cached version.
My problem is that while the resource URL is cached correctly, whenever I try to subsequently POST (create a new resource), PUT (update the resource) or DELETE (delete a resource), lwsw always returns a 405 "Method Not Allowed" response.
I suspect lsws thinks that since the static file exists on disk, it should refuse the request instead of dispatching it to the rails application. Is there any way to stop litespeed from returning the 405?
I have looked at using rewrite to fudge it, and while I can write a condition like
#RewriteCond %{REQUEST_METHOD} ^(POST|DELETE|PUT)$
to detect the incoming request is not a GET, I'm not sure what I can write the subsequent RewriteRule as in order to stop lsws from finding the cached page and instead dispatch to the rails application.
Any suggestions?
John.