On my debian 11 based mailserver I noticed some entries in my daily logs:
--------------------- httpd Begin ------------------------
Connection attempts using mod_proxy:
161.35.188.242 -> leakix.net:443: 1 Time(s)
92.118.39.30 -> example.com:443: 2 Time(s)
This happens almost every day for 1-3 entries with different IPs.
Researching just gives me results with httpd being a part of apache2 which I didn't install. I found some references for httpd being related to nginx which is part of my server setup.
cat /var/log/nginx/access.log | grep 161.35.188.242
indeed gives me various connection attempts to my server via the given IPs. Different threads recommend disabling mod_proxy in /etc/httpd/conf/httpd.conf and comment out everything in /etc/httpd/conf.d/proxy_ajp.conf. I don't have those files or even the httpd folder. There is a apache2 folder in /etc/ but it only contains php config stuff. I guess it's part of iRedMail to create a WebGUI for the mail access. There also seems to be a bug with apache 2.2 and apache 2.4 that will return a 200 (success) status code and the contents of the index.php site. To prevent this it's recommended to create a disable_connect.conf file in /etc/httpd/conf.d/ with some input (1) but I still don't have a /etc/httpd/ folder.
How to get rid of mod_proxy as it poses a potential security risk?
EDIT: Grégory Boddin suggested to use
curl -kx http(s)://<your-server-ip>:<your-server-port> http://ifconfig.me
http:80 results in:
curl: (56) Received HTTP code 400 from proxy after CONNECT
https:443 results in:
curl: (60) SSL: no alternative certificate subject name matches target host name 'xxx.xxx.xxx' More details here: curl.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.