From 204e3ed3ff7ee969b6eb211c3fa3ba15aed3737b Mon Sep 17 00:00:00 2001 From: opi Date: Fri, 4 Mar 2016 20:26:52 +0100 Subject: [PATCH] [fix] Use plain text 502 error page. --- data/templates/nginx/yunohost_api.conf.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/templates/nginx/yunohost_api.conf.inc b/data/templates/nginx/yunohost_api.conf.inc index 307eb4aa..35cd0090 100644 --- a/data/templates/nginx/yunohost_api.conf.inc +++ b/data/templates/nginx/yunohost_api.conf.inc @@ -4,4 +4,14 @@ location /yunohost/api/ { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + + # Custom 502 error page + error_page 502 /yunohost/api/error/502; +} + +# Yunohost admin output complete 502 error page, so use only plain text. +location = /yunohost/api/error/502 { + return 502 '502 - Bad Gateway'; + add_header Content-Type text/plain; + internal; }