I used Node-http-proxy to proxy my request from port sample.com:80 to port sample.com:8080 with sample below:
var httpProxy = require('http-proxy');
httpProxy.createServer(8080, 'localhost').listen(80);
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2));
res.end();
}).listen(9000);
When I do: curl with POST to sample.com:80, I get 403 Forbidden response. But when I do curl with GET, 301 permanent redirect. My question is:
Is it possible to make POST and GET behaves the same, which always return 200 status code instead of 403 or 301?
Thanks