Return http status ok (200) on request method OPTIONS Apache
- by jazz
I have a apache server which uses Reverse Proxy to connect/direct to a tomcat server.
Using virtualHost,
RequestHeader set X-Forwarded-Proto "http"
ServerName image.abc.local
DocumentRoot "/var/www/html"
ProxyRequests Off
ProxyTimeout 600
ProxyPass /abc http://image.abc.local:9001/abc
ProxyPass /xyz http://image.abc.local:9001/xyz
ProxyPassReverse /abc http://image.abc.local:9001/abc
ProxyPassReverse /xyz http://image.abc.local:9001/xyz
what i want to achieve here is that, when there is a REQUEST_METHOD OPTIONS i want simply return HTTP status OK (200). I dont want the request to be received by the tomcat server and process it. For performance based concerns i want this request to be handled at apache level.
with all the research i was still unable to get this to run;
RewriteEngine on
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule .* - [R=200m]
can somebody assist me with what rewrite rule should be there? or is there an alternative to RewriteEngine?
Thanks