Welcome! Log In Create A New Profile

Advanced

Check for existence of PHP socket availability with `nginx -t`

March 14, 2021 11:33AM
Hello.
I have some servers running PHP applications on Nginx via PHP-FPM. Each server uses a named socket in the filesystem. Nginx can often pass its configuration test but the server does not function as expected if the named socket file is not there (i.e. PHP-FPM is not running as expected).

Is it possible to integrate a check for the existence of that socket file in the `nginx -t` process? I am able to create a shell script to check for the socket and then run `nginx -t`, but I am wondering if there is a native route to check.

The server configs can have additional directives added outside of the PHP-speciflc `location` blocks, if that makes it more viable.

Thank you, and best wishes.

Pete
Subject Author Posted

Check for existence of PHP socket availability with `nginx -t`

petecooper March 14, 2021 11:33AM

Re: Check for existence of PHP socket availability with `nginx -t`

Maxim Dounin March 15, 2021 01:04AM

Re: Check for existence of PHP socket availability with `nginx -t`

petecooper March 15, 2021 02:23AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready