Home:ALL Converter>Apache Reverse Proxy MongoDB

Apache Reverse Proxy MongoDB

Ask Time:2021-05-23T02:25:10         Author:panch

Json Formatter

I have mongodb installed on Windows in an ip address 10.21.10.11:27017. When I am in the same network, I am able to connect to mongodb with the URL mongodb://10.21.10.11. However, I would like to access it from outside. For this, I need to do reverse proxy on Apache. What is the correct command to redirect? My attempts are like this

ProxyPass /MongoDB http://10.21.10.11:27017
ProxyPassReverse /MongoDB http://10.21.10.11:27017

But, it is not redirecting there.

I have also tried

  ProxyPass /MongoDB mongodb://10.21.10.11:27017
  ProxyPassReverse /MongoDB mongodb://10.21.10.11:27017

But it did not work. I have seen that a few people reported that it works well for nginx. Please post your answer, if anyone configured it correctly.

Author:panch,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67652892/apache-reverse-proxy-mongodb
yy