carini

Apache - BitNinja

Jul 27th, 2019
698
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. # Apache proxy conf with BitNinja
  2.  
  3. <VirtualHost *:80>
  4. ServerName example.com
  5. ServerAlias www.example.com
  6. ServerAdmin [email protected]
  7. # DocumentRoot needed for Let?s Encrypt challange file
  8. DocumentRoot "/var/www/html/example.com/http"
  9.  
  10. # Needed by BitNinja Web Application Firewall 2.0
  11. # See doc at https://doc.bitninja.io/modules/waf2.html
  12. <IfModule remoteip_module>
  13. RemoteIPHeader X-Forwarded-For
  14. RemoteIPInternalProxy 127.0.0.1 37.9.229.134 192.168.254.10
  15. </IfModule>
  16.  
  17. # Redirect aliases in non-ssl to the same alias on ssl, except for /.well-known/acme-challenge/ URIs
  18. RewriteEngine On
  19. RewriteCond %{REQUEST_URI} "!/.well-known/acme-challenge/"
  20. RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [NE,L,R=301]
  21.  
  22. LogLevel warn rewrite:trace3
  23. LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
  24. TransferLog /var/log/httpd/example.com-Transfer_log
  25. ErrorLog /var/log/httpd/example.com-Error_log
  26. </VirtualHost>
  27.  
  28. <VirtualHost *:443>
  29. ServerName example.com
  30. ServerAlias www.example.com
  31. ServerAdmin [email protected]
  32. # Indipendent DocumentRoot needed for Let?s Encrypt challange file
  33. DocumentRoot "/var/www/html/example.com/https"
  34.  
  35. # Needed by BitNinja Web Application Firewall 2.0
  36. # See doc at https://doc.bitninja.io/modules/waf2.html
  37. <IfModule remoteip_module>
  38. RemoteIPHeader X-Forwarded-For
  39. RemoteIPInternalProxy 127.0.0.1 37.9.229.134 192.168.254.10
  40. </IfModule>
  41.  
  42. # SSL CONFIGURATION #
  43. SSLEngine on
  44. SSLCertificateFile /etc/apache2/ssl/example.com.cer
  45. SSLCertificateKeyFile /etc/apache2/ssl/example.com.key
  46. SSLCACertificateFile /etc/apache2/ssl/ca.cer
  47.  
  48. ProxyPreserveHost on
  49. ProxyPass / http://x.x.x.x/
  50. ProxyPassReverse / http://x.x.x.x/
  51.  
  52. LogLevel warn rewrite:trace3
  53. LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
  54. TransferLog /var/log/httpd/example.com-ssl-Transfer_log
  55. ErrorLog /var/log/httpd/example.com-ssl-Error_log
  56. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment