Re: 503 - Maintenance page
You could modify your app so it returns a 200 status code in the header but shows the 503 error in the body. In that case your service should pass the health checks and haproxy should display the body with the 503 error. Am 2016-06-16 um 15:48 schrieb Philippe Lafoucrière: For the record, having /* redirected to /maintenance with a 307, then a 503 doesn't work either :( ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
So an alternative might be to use a temporary redirect on '/' - 302 to some site-under-maintenance-page (which can return a 503 http code w/ whatever custom page content you want). And who knows, that might also make a http purist happier!! ;^) On Wed, Jun 8, 2016 at 7:31 AM, Philippe Lafoucrière < philippe.lafoucri...@tech-angels.com> wrote: > > On Tue, Jun 7, 2016 at 6:45 PM, Ram Ranganathan> wrote: > >> Is your server always returning 503 - example for a GET/HEAD on / ? That >> could cause haproxy to mark it as down. >> >> You can also see the stats in haproxy to look at if the server has been >> marked down: >> cmd="echo 'show stat' | socat >> unix-connect:/var/lib/haproxy/run/haproxy.sock stdio" >> echo "$cmd" | oc rsh # replace with router pod >> name. >> > > Of course my server is returning a 503 for "/' :) (it's down for > maintenance). Haproxy thinks no server is available, so it's not even > trying to pass the page. Make sense. > Ok, so I guess I'll to use a custom router then :( > > Thanks for your help. > Philippe > -- Ram// main(O,s){s=--O;10 >4*s)*(O++?-1:1):10)&&\ main(++O,s++);} ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
On Tue, Jun 7, 2016 at 6:45 PM, Ram Ranganathanwrote: > Is your server always returning 503 - example for a GET/HEAD on / ? That > could cause haproxy to mark it as down. > > You can also see the stats in haproxy to look at if the server has been > marked down: > cmd="echo 'show stat' | socat > unix-connect:/var/lib/haproxy/run/haproxy.sock stdio" > echo "$cmd" | oc rsh # replace with router pod > name. > Of course my server is returning a 503 for "/' :) (it's down for maintenance). Haproxy thinks no server is available, so it's not even trying to pass the page. Make sense. Ok, so I guess I'll to use a custom router then :( Thanks for your help. Philippe ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
Hmm, so 503 is also returned by haproxy if no server is available to service a request (example for a backend with no servers or if the server is not available failing the health check). As I recall, we did the error page on a request as it gives the ability to override it in a custom template. Now that said, if the app (server associated with a haproxy backend) is returning 503s, that content should get passed back as is. Meaning you should see your custom error page being returned back to the server. I just tested this out with a repo I have: https://github.com/ramr/nodejs-header-echo/blob/master/server.js#L12 and it returns the content + status code back to the requester. If that's not the case - from what you are seeing, it is more than likely that haproxy has marked the backend server down as unavailable - which means its failing health checks. Is your server always returning 503 - example for a GET/HEAD on / ? That could cause haproxy to mark it as down. You can also see the stats in haproxy to look at if the server has been marked down: cmd="echo 'show stat' | socat unix-connect:/var/lib/haproxy/run/haproxy.sock stdio" echo "$cmd" | oc rsh # replace with router pod name. HTH On Tue, Jun 7, 2016 at 12:56 PM, Philippe Lafoucrière < philippe.lafoucri...@tech-angels.com> wrote: > > On Tue, Jun 7, 2016 at 3:46 PM, Luke Meyerwrote: > >> It sounds like what he wants is for the router to simply not interfere >> with passing along something that's already returning a 503. It sounds like >> haproxy is replacing the page content with its own in that use case. > > > THANKS Luke :)) > I don't want to change the router, I just want it to point to a specific > service returning 503 for most URLs. > On the other hand, the SAME router is used (with another route) to point > to the production service, with a different URL if we want to test the > change. > Imagine a migration from pg 9.4 to 9.5, you have to shutdown your site. > That doesn't mean traffic can't be routed any more, we like to test the > site after the migration, and before resuming all the public traffic. > > -- Ram// main(O,s){s=--O;10 >4*s)*(O++?-1:1):10)&&\ main(++O,s++);} ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
On Tue, Jun 7, 2016 at 3:46 PM, Luke Meyerwrote: > It sounds like what he wants is for the router to simply not interfere > with passing along something that's already returning a 503. It sounds like > haproxy is replacing the page content with its own in that use case. THANKS Luke :)) I don't want to change the router, I just want it to point to a specific service returning 503 for most URLs. On the other hand, the SAME router is used (with another route) to point to the production service, with a different URL if we want to test the change. Imagine a migration from pg 9.4 to 9.5, you have to shutdown your site. That doesn't mean traffic can't be routed any more, we like to test the site after the migration, and before resuming all the public traffic. ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
It sounds like what he wants is for the router to simply not interfere with passing along something that's already returning a 503. It sounds like haproxy is replacing the page content with its own in that use case. On Mon, Jun 6, 2016 at 11:53 PM, Ram Ranganathanwrote: > Not clear if you want the router to automatically serve the 503 page or > not. If you do, this line in the haproxy config template: > > https://github.com/openshift/origin/blob/master/images/router/haproxy/conf/haproxy-config.template#L198 > > automatically sends a 503 page if your service is down (example has 0 pods > backing the service). > The actual error page template is at: > > https://github.com/openshift/origin/blob/master/images/router/haproxy/conf/error-page-503.http > > > You could customize the template and/or error page (and the router image) > to use a different page. > > Alternatively, if you desire some other behavior, you can disable it by > removing that haproxy directive. Does still need a custom template + router > image. > > HTH. > > > On Mon, Jun 6, 2016 at 12:58 PM, Philippe Lafoucrière < > philippe.lafoucri...@tech-angels.com> wrote: > >> @Clayton: >> Sorry for the confusion. I'm not updating the routeR, I'm updating the >> route directly. The route to our website is pointing to a "maintenance" >> service during maintenance. This service serves 503 pages for most URLs, >> except a few for testing purprose. >> >> The problem is: If I browse my website, I get the expected 503 code, but >> a blank page, instead of the desired maintenance page served by the >> "maintenance" pods. I don't understand this blank page, it's like haproxy >> is not forwarding it because the pods responded with a 503. >> >> @v: Can I use a dedicated router per project? >> >> Thanks >> >> ___ >> users mailing list >> users@lists.openshift.redhat.com >> http://lists.openshift.redhat.com/openshiftmm/listinfo/users >> >> > > > -- > Ram// > main(O,s){s=--O;10 >4*s)*(O++?-1:1):10)&&\ > main(++O,s++);} > > ___ > users mailing list > users@lists.openshift.redhat.com > http://lists.openshift.redhat.com/openshiftmm/listinfo/users > > ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
Not clear if you want the router to automatically serve the 503 page or not. If you do, this line in the haproxy config template: https://github.com/openshift/origin/blob/master/images/router/haproxy/conf/haproxy-config.template#L198 automatically sends a 503 page if your service is down (example has 0 pods backing the service). The actual error page template is at: https://github.com/openshift/origin/blob/master/images/router/haproxy/conf/error-page-503.http You could customize the template and/or error page (and the router image) to use a different page. Alternatively, if you desire some other behavior, you can disable it by removing that haproxy directive. Does still need a custom template + router image. HTH. On Mon, Jun 6, 2016 at 12:58 PM, Philippe Lafoucrière < philippe.lafoucri...@tech-angels.com> wrote: > @Clayton: > Sorry for the confusion. I'm not updating the routeR, I'm updating the > route directly. The route to our website is pointing to a "maintenance" > service during maintenance. This service serves 503 pages for most URLs, > except a few for testing purprose. > > The problem is: If I browse my website, I get the expected 503 code, but a > blank page, instead of the desired maintenance page served by the > "maintenance" pods. I don't understand this blank page, it's like haproxy > is not forwarding it because the pods responded with a 503. > > @v: Can I use a dedicated router per project? > > Thanks > > ___ > users mailing list > users@lists.openshift.redhat.com > http://lists.openshift.redhat.com/openshiftmm/listinfo/users > > -- Ram// main(O,s){s=--O;10>4*s)*(O++?-1:1):10)&&\ main(++O,s++);} ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users
Re: 503 - Maintenance page
@Clayton: Sorry for the confusion. I'm not updating the routeR, I'm updating the route directly. The route to our website is pointing to a "maintenance" service during maintenance. This service serves 503 pages for most URLs, except a few for testing purprose. The problem is: If I browse my website, I get the expected 503 code, but a blank page, instead of the desired maintenance page served by the "maintenance" pods. I don't understand this blank page, it's like haproxy is not forwarding it because the pods responded with a 503. @v: Can I use a dedicated router per project? Thanks ___ users mailing list users@lists.openshift.redhat.com http://lists.openshift.redhat.com/openshiftmm/listinfo/users