0

I have an apache server running, and on this server I have a mongo database running too, listening on standard port 27017.

Is there a way to make a reverse proxy in apache configuration to send requests to my mongo database ?

I tried this, but it doesn't seem to works at all :

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName *********

    # DocumentRoot /var/www/test

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ProxyPreserveHost On
    ProxyPass / http://localhost:27017/
    ProxyPassReverse / http://localhost:27017/
</VirtualHost>
Synedh
  • 11
  • 2

1 Answers1

0

Your requirement needs a TCP proxy and not a HTTP proxy which you are trying to do using Apache. You can use software based like nginx or squid as TCP proxy server or by using pure NAT configuration based on iptables also is possible.

Couple of answers which can help you. TCP proxy mongodb with nginx proxy

raghavendrap
  • 141
  • 8