Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Apache proxy conf with BitNinja
- <VirtualHost *:80>
- ServerName example.com
- ServerAlias www.example.com
- ServerAdmin [email protected]
- # DocumentRoot needed for Let?s Encrypt challange file
- DocumentRoot "/var/www/html/example.com/http"
- # Needed by BitNinja Web Application Firewall 2.0
- # See doc at https://doc.bitninja.io/modules/waf2.html
- <IfModule remoteip_module>
- RemoteIPHeader X-Forwarded-For
- RemoteIPInternalProxy 127.0.0.1 37.9.229.134 192.168.254.10
- </IfModule>
- # Redirect aliases in non-ssl to the same alias on ssl, except for /.well-known/acme-challenge/ URIs
- RewriteEngine On
- RewriteCond %{REQUEST_URI} "!/.well-known/acme-challenge/"
- RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [NE,L,R=301]
- LogLevel warn rewrite:trace3
- LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
- TransferLog /var/log/httpd/example.com-Transfer_log
- ErrorLog /var/log/httpd/example.com-Error_log
- </VirtualHost>
- <VirtualHost *:443>
- ServerName example.com
- ServerAlias www.example.com
- ServerAdmin [email protected]
- # Indipendent DocumentRoot needed for Let?s Encrypt challange file
- DocumentRoot "/var/www/html/example.com/https"
- # Needed by BitNinja Web Application Firewall 2.0
- # See doc at https://doc.bitninja.io/modules/waf2.html
- <IfModule remoteip_module>
- RemoteIPHeader X-Forwarded-For
- RemoteIPInternalProxy 127.0.0.1 37.9.229.134 192.168.254.10
- </IfModule>
- # SSL CONFIGURATION #
- SSLEngine on
- SSLCertificateFile /etc/apache2/ssl/example.com.cer
- SSLCertificateKeyFile /etc/apache2/ssl/example.com.key
- SSLCACertificateFile /etc/apache2/ssl/ca.cer
- ProxyPreserveHost on
- ProxyPass / http://x.x.x.x/
- ProxyPassReverse / http://x.x.x.x/
- LogLevel warn rewrite:trace3
- LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
- TransferLog /var/log/httpd/example.com-ssl-Transfer_log
- ErrorLog /var/log/httpd/example.com-ssl-Error_log
- </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment