httpd.conf 866 B

123456789101112131415161718192021
  1. # custom apache configuration rules
  2. # dontlog flag is optional; determines whether or not this visit is recorded to apache's logs
  3. <Location />
  4. # deny access to useless bots
  5. SetEnvIfNoCase User-Agent "^Wget" bad_bot dontlog
  6. SetEnvIfNoCase User-Agent "^archive.org_bot" bad_bot dontlog
  7. Deny from env=bad_bot # 403/forbidden (request blocked)
  8. # deny attempts to access via the server's ip address to all virtual hosts; ie. http://127.0.0.1/phpmyadmin
  9. SetEnvIf Host ^[0-9] no_ip dontlog
  10. # since we cannot use conditions for env, set a rule immediately after to whitelist a specific
  11. # numerically-prefixed subdomain (based on hostname) hosted on this server
  12. SetEnvIf Host 4widgets\.widgets\.ext whitelist
  13. Deny from env=no_ip # 403/forbidden (request blocked)
  14. Allow from env=whitelist # 200/ok (allowed access)
  15. </Location>