Skip to content

Commit

Permalink
Put headers and request headers before proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
quixoten committed Dec 18, 2015
1 parent 73d2205 commit 1bce7b2
Showing 1 changed file with 42 additions and 43 deletions.
85 changes: 42 additions & 43 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
$passenger_base_uris = undef,
$headers = undef,
$request_headers = undef,
$request_headers_order = 250,
$filters = undef,
$rewrites = undef,
$rewrite_base = undef,
Expand Down Expand Up @@ -675,6 +674,26 @@
}
}

# Template uses:
# - $headers
if $headers and ! empty($headers) {
concat::fragment { "${name}-header":
target => "${priority_real}${filename}.conf",
order => 140,
content => template('apache/vhost/_header.erb'),
}
}

# Template uses:
# - $request_headers
if $request_headers and ! empty($request_headers) {
concat::fragment { "${name}-requestheader":
target => "${priority_real}${filename}.conf",
order => 150,
content => template('apache/vhost/_requestheader.erb'),
}
}

# Template uses:
# - $proxy_dest
# - $proxy_pass
Expand All @@ -684,7 +703,7 @@
if $proxy_dest or $proxy_pass or $proxy_pass_match or $proxy_dest_match {
concat::fragment { "${name}-proxy":
target => "${priority_real}${filename}.conf",
order => 140,
order => 160,
content => template('apache/vhost/_proxy.erb'),
}
}
Expand All @@ -694,7 +713,7 @@
if $rack_base_uris {
concat::fragment { "${name}-rack":
target => "${priority_real}${filename}.conf",
order => 150,
order => 170,
content => template('apache/vhost/_rack.erb'),
}
}
Expand All @@ -704,7 +723,7 @@
if $passenger_base_uris {
concat::fragment { "${name}-passenger_uris":
target => "${priority_real}${filename}.conf",
order => 155,
order => 175,
content => template('apache/vhost/_passenger_base_uris.erb'),
}
}
Expand All @@ -725,7 +744,7 @@
if ($redirect_source and $redirect_dest) or ($redirectmatch_status and $redirectmatch_regexp and $redirectmatch_dest) {
concat::fragment { "${name}-redirect":
target => "${priority_real}${filename}.conf",
order => 160,
order => 180,
content => template('apache/vhost/_redirect.erb'),
}
}
Expand All @@ -739,7 +758,7 @@
if $rewrites or $rewrite_rule {
concat::fragment { "${name}-rewrite":
target => "${priority_real}${filename}.conf",
order => 170,
order => 190,
content => template('apache/vhost/_rewrite.erb'),
}
}
Expand All @@ -750,7 +769,7 @@
if ( $scriptalias or $scriptaliases != [] ) {
concat::fragment { "${name}-scriptalias":
target => "${priority_real}${filename}.conf",
order => 180,
order => 200,
content => template('apache/vhost/_scriptalias.erb'),
}
}
Expand All @@ -760,7 +779,7 @@
if $serveraliases and ! empty($serveraliases) {
concat::fragment { "${name}-serveralias":
target => "${priority_real}${filename}.conf",
order => 190,
order => 210,
content => template('apache/vhost/_serveralias.erb'),
}
}
Expand All @@ -771,7 +790,7 @@
if ($setenv and ! empty($setenv)) or ($setenvif and ! empty($setenvif)) {
concat::fragment { "${name}-setenv":
target => "${priority_real}${filename}.conf",
order => 200,
order => 220,
content => template('apache/vhost/_setenv.erb'),
}
}
Expand All @@ -797,7 +816,7 @@
if $ssl {
concat::fragment { "${name}-ssl":
target => "${priority_real}${filename}.conf",
order => 210,
order => 230,
content => template('apache/vhost/_ssl.erb'),
}
}
Expand All @@ -810,7 +829,7 @@
if $ssl_proxyengine {
concat::fragment { "${name}-sslproxy":
target => "${priority_real}${filename}.conf",
order => 210,
order => 230,
content => template('apache/vhost/_sslproxy.erb'),
}
}
Expand All @@ -826,7 +845,7 @@
if $auth_kerb {
concat::fragment { "${name}-auth_kerb":
target => "${priority_real}${filename}.conf",
order => 210,
order => 230,
content => template('apache/vhost/_auth_kerb.erb'),
}
}
Expand All @@ -838,7 +857,7 @@
if $suphp_engine == 'on' {
concat::fragment { "${name}-suphp":
target => "${priority_real}${filename}.conf",
order => 220,
order => 240,
content => template('apache/vhost/_suphp.erb'),
}
}
Expand All @@ -849,7 +868,7 @@
if ($php_values and ! empty($php_values)) or ($php_flags and ! empty($php_flags)) {
concat::fragment { "${name}-php":
target => "${priority_real}${filename}.conf",
order => 220,
order => 240,
content => template('apache/vhost/_php.erb'),
}
}
Expand All @@ -860,31 +879,11 @@
if ($php_admin_values and ! empty($php_admin_values)) or ($php_admin_flags and ! empty($php_admin_flags)) {
concat::fragment { "${name}-php_admin":
target => "${priority_real}${filename}.conf",
order => 230,
order => 250,
content => template('apache/vhost/_php_admin.erb'),
}
}

# Template uses:
# - $headers
if $headers and ! empty($headers) {
concat::fragment { "${name}-header":
target => "${priority_real}${filename}.conf",
order => 240,
content => template('apache/vhost/_header.erb'),
}
}

# Template uses:
# - $request_headers
if $request_headers and ! empty($request_headers) {
concat::fragment { "${name}-requestheader":
target => "${priority_real}${filename}.conf",
order => $request_headers_order,
content => template('apache/vhost/_requestheader.erb'),
}
}

# Template uses:
# - $wsgi_application_group
# - $wsgi_daemon_process
Expand All @@ -897,7 +896,7 @@
if $wsgi_application_group or $wsgi_daemon_process or ($wsgi_import_script and $wsgi_import_script_options) or $wsgi_process_group or ($wsgi_script_aliases and ! empty($wsgi_script_aliases)) or $wsgi_pass_authorization {
concat::fragment { "${name}-wsgi":
target => "${priority_real}${filename}.conf",
order => 260,
order => 280,
content => template('apache/vhost/_wsgi.erb'),
}
}
Expand All @@ -907,7 +906,7 @@
if $custom_fragment {
concat::fragment { "${name}-custom_fragment":
target => "${priority_real}${filename}.conf",
order => 270,
order => 290,
content => template('apache/vhost/_custom_fragment.erb'),
}
}
Expand All @@ -920,7 +919,7 @@
if $fastcgi_server or $fastcgi_dir {
concat::fragment { "${name}-fastcgi":
target => "${priority_real}${filename}.conf",
order => 280,
order => 300,
content => template('apache/vhost/_fastcgi.erb'),
}
}
Expand All @@ -930,7 +929,7 @@
if $suexec_user_group {
concat::fragment { "${name}-suexec":
target => "${priority_real}${filename}.conf",
order => 290,
order => 310,
content => template('apache/vhost/_suexec.erb'),
}
}
Expand All @@ -945,7 +944,7 @@
if $passenger_app_root or $passenger_app_env or $passenger_ruby or $passenger_min_instances or $passenger_start_timeout or $passenger_pre_start {
concat::fragment { "${name}-passenger":
target => "${priority_real}${filename}.conf",
order => 300,
order => 320,
content => template('apache/vhost/_passenger.erb'),
}
}
Expand All @@ -955,7 +954,7 @@
if $add_default_charset {
concat::fragment { "${name}-charsets":
target => "${priority_real}${filename}.conf",
order => 310,
order => 330,
content => template('apache/vhost/_charsets.erb'),
}
}
Expand All @@ -968,7 +967,7 @@
if $modsec_disable_vhost or $modsec_disable_ids or $modsec_disable_ips {
concat::fragment { "${name}-security":
target => "${priority_real}${filename}.conf",
order => 320,
order => 340,
content => template('apache/vhost/_security.erb')
}
}
Expand All @@ -978,7 +977,7 @@
if $filters and ! empty($filters) {
concat::fragment { "${name}-filters":
target => "${priority_real}${filename}.conf",
order => 330,
order => 350,
content => template('apache/vhost/_filters.erb'),
}
}
Expand Down

0 comments on commit 1bce7b2

Please sign in to comment.