Add option for custom error pages (#276)

This commit is contained in:
Emile Broeders 2020-07-01 12:22:37 +02:00 committed by GitHub
parent c1b707cc5b
commit 63325aac0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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:

View File

@ -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
#