I've been trying to setup apache (port 80) as a reverse proxy to a nodejs server (port 3000) and I made the mistake of launching my apache server with ProxyRequests On
. I discovered this error after hundreds of thousands of spam proxy requests ballooned the access.log file and my small 8GB dev server crashed with no disk space. Now I'm trying to figure out the proper way to secure my virtual host.
My virtualhost config to route all requests from port 80 to 3000 (my nodejs server)
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/path-to-my-site
ProxyRequests Off
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
ProxyTimeout 60
</VirtualHost>
I think this config should work but I'm not sure how to verify it. I start apache and I still requests like these (none of these are my domain).
208.115.232.246 - - [04/May/2020:11:06:03 -0400] "CONNECT bcqapi.muuky.cc:8043 HTTP/1.1" 502 383
208.115.232.246 - - [04/May/2020:13:29:27 -0400] "GET http://finalcheat.pw/ HTTP/1.1" 200 9368
91.199.118.175 - - [04/May/2020:11:06:04 -0400] "GET http://205.198.7.143/ HTTP/1.1" 200 9368
91.199.118.175 - - [04/May/2020:11:06:04 -0400] "GET http://205.198.7.143/ HTTP/1.1" 200 9368
91.199.118.175 - - [04/May/2020:11:06:04 -0400] "GET http://205.198.7.143/ HTTP/1.1" 404 1089
208.115.232.250 - - [04/May/2020:11:06:13 -0400] "CONNECT www.hg77733.net:443 HTTP/1.1" 502 383
208.115.232.206 - - [04/May/2020:12:26:24 -0400] "GET http://www.7mx1.com/user/signup/ HTTP/1.1" 403 214
I would expect the server to hand out 502 and 403 errors to these requests but the 200 and 404 errors concern me. Doesn't that imply those requests were accepted by the server and my server is still insecure? If so how do I prevent requests from other domains?
If my config is secure, is there a way to prevent logging these requests altogether so I don't run out of disk space?