Add option for custom error pages (#276)
This commit is contained in:
parent
c1b707cc5b
commit
63325aac0b
@ -77,6 +77,7 @@ nginx_http_template:
|
||||
opts: [] # Listen opts like http2 which will be added (ssl is automatically added if you specify 'ssl:').
|
||||
server_name: localhost
|
||||
include_files: []
|
||||
http_error_pages: {}
|
||||
error_page: /usr/share/nginx/html
|
||||
access_log:
|
||||
- name: main
|
||||
|
@ -77,6 +77,8 @@
|
||||
opts:
|
||||
- default_server
|
||||
server_name: localhost
|
||||
http_error_pages:
|
||||
404: /404.html
|
||||
error_page: /usr/share/nginx/html
|
||||
client_max_body_size: 512k
|
||||
proxy_hide_headers:
|
||||
|
@ -475,6 +475,12 @@ server {
|
||||
}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if item.value.servers[server].http_error_pages is defined %}
|
||||
# redirect server error pages
|
||||
{% for error_code in item.value.servers[server].http_error_pages %}
|
||||
error_page {{ error_code }} {{ item.value.servers[server].http_error_pages[error_code] }};
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if item.value.servers[server].error_page is defined %}
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user