XF 1.2 Inactive board gives 503 response which causes issues with Incapsula

DOA

Member
Hi,

Am I correct in thinking that XF tells my server to give a 503 response when the board is to set inactive?

Because everytime I set to inactive, incapsula seems to read the response and gives a message saying it can not connect to the server.

Pingdom and other services also say the site is offline with a 503 response.

Is this how XF is configured to work, or is something going wrong? If it is correct, is there anyway I can change the response?
 
Yes, it does return a 503, I don't know why Incapsula would be interpreting an authorization error as not being able to connect to the server.

Are you using nginx? Maybe you don't have a page setup for your 503 errors to display, and your server is really throwing a different 50x error, which Incapsula is seeing.
 
I'm using litespeed.

Actually Incapsula is saying:
Error Name TCP Connection Timeout Error Description The proxy failed to
connect to the web server, due to TCP connection timeout.
 
That seems strange to me, I don't use either Incapsula nor Litespeed, so I'm sorry I can't be of much help.

Is there a support system with Incapsula that you can forward that information to?
 
I found the problem.

Under Basic Board Information, I had changed the index page route from 'forums/' to '/'. My forum is on the root on the domain so thought I needed to take this out, wasn't quite sure what it meant. I've put it back and seems to work now

EDIT: nope, wasn't that, hit the error again, argh
 
Last edited:
503 means temporarily unavailable, so technically it is saying your site is temporarily offline, which it is.

Uptime services look for 200 status codes, which are returned whenever the site works correctly.

Liam
 
I find the 503 a major pain - and I really dont see the need for this 'feature'. If the site is 'inactive ' mode, it is still a service that is working, people will see a message, admins can still administrate, delivering a 503 message is simply wrong. The site may not be fully operational - but it is operational. Sites may be set to inactive mode that may be legal rather than technical in nature.

The reason why is causes me grief is that our web servers sit behind a load balancer - if the site is returning 503's, the load balancer will drop the server. That means my users dont see any nice friendly messages saying maintenance is being run or the likely expected return time. As an admin I also have to use some alternative url to turn the board back on.

What's more as part of our high availability plan, if web servers drop out of the load balancer, new servers are spun up automatically, so before I do maintenance I have to remember the adjust the auto-scaling routine so that I dont end up incurring the cost of running additional unnecessary servers, and I have to remember to readjust auto-scaling after the maintenance.
 
If the site is 'inactive ' mode, it is still a service that is working
It really is appropriate, then, to return a 503 response code. What would you suggest? 200? The problem with returning a 200 OK code when the site is unavailable is that Google will hit your site and start crawling it every time it goes to a new URL it will see the same content and it will see your server saying "OK". So all of the content you have indexed will likely be reindexed with your board closed message. Then there's the danger you will get penalised for duplicate content.

It doesn't matter how you look at it, returning anything but 503 is simply wrong.

It seems like it provides you with some technical difficulties. But they seem pretty manageable. Is your load balancer configurable so it doesn't drop when a 503 is returned? 503 is literally "Temporarily Unavailable" it isn't necessary for your load balancer to attempt a switch over in that situation. The board being inactive is the only place this will show up. I'd have thought any decent system for managing load balancing would enable you to fine tune that behaviour with that response code.
 
Amazon ELB - It expects a 200, I do not have control over how that works. I am not talking tin pot installations.

As for 503, the site is working, you may not like the way it is working, but it is working. 503 is simply wrong.

What Xenforo should be doing is using 307 or 302 redirects for any page that isn't being served as expected, that's what those HTTP exist for and your googles understand that pages returning those codes should be in maintenance mode and as such wont chuck out your content
 
3xx responses are completely inappropriate. They are for redirections.

Returning a 200 is totally incorrect as it would indicate that the content that is displayed is the permanent content as well.

503 is the correct response as defined in the RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.

If you need to change this for your particular needs, I would have to recommend modifying the code.
 
To be honest what I really need is just a page that I can hit that does a really basic check, eg php is working, the server isn't overloaded and it can speak to the database and cache, it doesn't have to have any content, just return a 200, regardless of the active mode of the site.
 
If you really must change it, and I strongly advise against it because the implementation is entirely appropriate and correct, then find the file:

library/XenForo/ControllerPublic/Abstract.php

Line 224 (in the current 1.3 beta) is:
PHP:
throw $this->responseException($this->responseMessage($options->boardInactiveMessage), 503);

Change the 503 to the desired HTTP response code.
 
No, I've decided i am going to have write my own health check - not an add on - just a separate piece of code that utilises the config file and nothing else from Xenforo
 
If you really must change it, and I strongly advise against it because the implementation is entirely appropriate and correct, then find the file:

library/XenForo/ControllerPublic/Abstract.php

Line 224 (in the current 1.3 beta) is:
PHP:
throw $this->responseException($this->responseMessage($options->boardInactiveMessage), 503);

Change the 503 to the desired HTTP response code.
How about on XF 2.1?
Thanks!
 
Top Bottom