skip to Main Content

I have used ProxyPass for the node app in apache server. Now when I call the url with the browser then I get response GET / 200 206.324 ms - 14 but when the same url hit by another server which send data via POST over the same url then I got POST / 404 8.154 ms - 140 response.

ProxyPass I have set is like "ProxyPass /myapi http://localhost:3000"

Please let me know if I am missing something.

I have even changed localhost to my site domain in proxypass but still issue is same, we can access it via browser but not from Network request.

Service provide whitelisted the IPs which server uses for triggering the url.

2

Answers


  1. Chosen as BEST ANSWER

    There is a problem with server that it was allowing to hit post data only by some whitelisted IPs. So for accessing port 3000 of my app service provider given access to IP rangeswhich 3rd party server uses for sending post data.

    One more thing I did is set proxyPass like this

    ProxyPass /myapi http://mysite:3000/ 
    ProxyPassReverse / http://mysite:3000/
    

    also set mysite as a host in node app.

    I was also missing to capture post in express due to this I was getting error 404. Since data is sent via post from another server then I need to capture it in post.


  2. The ProxyPass needs to end with a slash, also write ProxyPassReverse.

    Just make the following change:

    ProxyPass /myapi http://localhost:3000/ 
    ProxyPassReverse / http://localhost:3000/
    

    Reference Link

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search