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