I'm writing a REST API (nodejs/express) that's running locally on my server (listening to port 3000); I have an existing Apache server set up, and I want to configure it to reroute api calls to the node instance. Below is my current Apache config, using ProxyPass:
<VirtualHost _default_:80>
DocumentRoot "/opt/bitnami/apache2/htdocs"
<Directory "/opt/bitnami/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>
# Error Documents
ErrorDocument 503 /503.html
# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
ProxyPreserveHost On
ProxyPass /api http://localhost:3000
ProxyPassReverse /api http://localhost:3000
</VirtualHost>
The issue I'm having is that PUT and POST requests are getting converted to GET requests when they get passed from Apache to Node; I didn't originally think it was this issue since I'm not sending a redirect code to the client at all, but I don't have another better guess. Has anyone seen this issue before // have a way to force the requests to maintain their type when they get passed through?