Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a REST api that is invoked by a Javascript Web application. HTML/CSS and JS files are stored locally and served by Apache, and the REST api is invoked with a ProxyPass directive by Apache on a remote HTTP server. This is my actual httpd.conf file (development machine is on windows):

<VirtualHost *:80>
    ServerName myapp.com
    DocumentRoot C:\myapp

    <Directory />
        Allow from all
    </Directory>

    RewriteLog C:\Temp\rewrite.log
    RewriteLogLevel 0
    RewriteEngine On

    # Let apache serve static files
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
    RewriteRule (.*) $1 [L]

    ProxyPass / http://192.168.0.23:4567/ retry=0
    ProxyPassReverse / http://192.168.0.23:4567/
    ProxyPreserveHost on
</VirtualHost>

My problem is that the remote server (192.168.0.23) does not support DELETE and PUT requests (I get a Method not allowed error if I try to do that). Unfortunately i don't have access to that server, but I can develop the REST api exposed by it. What I would like to do is

  • check if the incoming request is DELETE or PUT
  • set an HTTP header on the request X-ORIGINAL-REQUEST_METHOD: DELETE
  • forward the request to the remote server (192.168.0.23) as POST

can this somehow be done with Apache rewrite rules or some other module?

share|improve this question
    
That sounds like an ugly hack. Having those methods working is kinda a must for a REST API - is it blocking them intentionally? What HTTP server software is it running? –  Shane Madden Jan 27 '12 at 23:55
    
Yes, it's an ugly hack I know, but as a workaround it should work, if I can get it working that way. The HTTP server software is the "Oracle Embedded PL/SQL Gateway". –  Simon Jan 30 '12 at 10:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.