adds directory control for errors
This commit is contained in:
@@ -38,5 +38,17 @@ class cd_haproxy::main::dirs (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# errors dir
|
||||
file { $hy_errors_dir:
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,5 +58,20 @@ class cd_haproxy::main::files (
|
||||
seltype => haproxy_var_run_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# error files
|
||||
file { $hy_400_file:
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($hy_400_erb),
|
||||
notify => Service[$hy_service],
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,10 +123,13 @@ $hy_service = 'haproxy'
|
||||
|
||||
# directories
|
||||
$hy_main_dir = '/etc/haproxy'
|
||||
$hy_errors_dir = "${hy_main_dir}/errors"
|
||||
|
||||
# files
|
||||
$hy_main_config = "${hy_main_dir}/haproxy.cfg"
|
||||
$hy_config_head_erb = 'cd_haproxy/haproxy_head.erb'
|
||||
$hy_400_file = "${hy_errors_dir}/400.http"
|
||||
$hy_400_erb = 'cd_haproxy/400_http.erb'
|
||||
|
||||
# includes must be last
|
||||
|
||||
|
||||
9
templates/errors/400_http.erb
Normal file
9
templates/errors/400_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 400 Bad request
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>400 Bad request</h1>
|
||||
Your browser sent an invalid request.
|
||||
</body></html>
|
||||
|
||||
9
templates/errors/403_http.erb
Normal file
9
templates/errors/403_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 403 Forbidden
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>403 Forbidden</h1>
|
||||
Request forbidden by administrative rules.
|
||||
</body></html>
|
||||
|
||||
9
templates/errors/408_http.erb
Normal file
9
templates/errors/408_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 408 Request Time-out
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>408 Request Time-out</h1>
|
||||
Your browser didn't send a complete request in time.
|
||||
</body></html>
|
||||
|
||||
9
templates/errors/500_http.erb
Normal file
9
templates/errors/500_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 500 Server Error
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>500 Server Error</h1>
|
||||
An internal server error occured.
|
||||
</body></html>
|
||||
|
||||
9
templates/errors/502_http.erb
Normal file
9
templates/errors/502_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 502 Bad Gateway
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>502 Bad Gateway</h1>
|
||||
The server returned an invalid or incomplete response.
|
||||
</body></html>
|
||||
|
||||
9
templates/errors/503_http.erb
Normal file
9
templates/errors/503_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 503 Service Unavailable
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>503 Service Unavailable</h1>
|
||||
No server is available to handle this request.
|
||||
</body></html>
|
||||
|
||||
9
templates/errors/504_http.erb
Normal file
9
templates/errors/504_http.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
HTTP/1.0 504 Gateway Time-out
|
||||
Cache-Control: no-cache
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
|
||||
<html><body><h1>504 Gateway Time-out</h1>
|
||||
The server didn't respond in time.
|
||||
</body></html>
|
||||
|
||||
Reference in New Issue
Block a user