Merge "Allow for ability to block status.json referers"

This commit is contained in:
Jenkins 2015-08-12 19:44:28 +00:00 committed by Gerrit Code Review
commit 95403bb22d
2 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class zuul (
$proxy_ssl_cert_file_contents = '',
$proxy_ssl_key_file_contents = '',
$proxy_ssl_chain_file_contents = '',
$block_referers = [],
) {
include ::httpd
include pip

View File

@ -19,6 +19,10 @@
CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined
RewriteEngine on
<% @block_referers.each do |referer| -%>
RewriteCond %{HTTP_REFERER} =<%= referer %>
RewriteRule ^/status.json - [F]
<% end -%>
RewriteRule ^/status.json$ http://127.0.0.1:8001/status.json [P]
RewriteRule ^/status/(.*) http://127.0.0.1:8001/status/$1 [P]
@ -80,6 +84,10 @@
CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined
RewriteEngine on
<% @block_referers.each do |referer| -%>
RewriteCond %{HTTP_REFERER} =<%= referer %>
RewriteRule ^/status.json - [F]
<% end -%>
RewriteRule ^/status.json$ http://127.0.0.1:8001/status.json [P]
RewriteRule ^/status/(.*) http://127.0.0.1:8001/status/$1 [P]