Render custom status to both browser and REST API Client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Is there a way to configure apache httpd 2.4.55 as per the below flow when the below conditions occurs

User -> Apache Web Server -> PHP-FPM Upstream server -> MySQL DB

Condition 1 when MySQL DB is down
When MySQL DB is down, httpd to render JSON output when invoking http://mydomain.com/apis by the user using postman rest api client.
JSON Output
{"status_code": 500, "status" : "MySQL DB Server is down"}

HTML Output
HTML output when invoking http://mydomain.com/apis using client browser.

Condition 2 when PHP-FPM is down
When PHP-FPM Upstream server is down, httpd to render JSON output when invoking http://mydomain.com/apis by the user using postman rest api client.
JSON Output
{"status_code": 502, "status": "php-fpm server is down"}}';

HTML Output
HTML output when invoking http://mydomain.com/apis using client browser.

Please guide me. 

Best Regards,

Kaushal

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux