1 year ago

Laravel Forge - Nginx respond on IP

Posted 1 year ago by elliotk

I have been using Forge for some time, with my servers behind a load balancer (Digital Ocean). DO is currently configured to do a simple check of port 80 using TCP. This detects if the server is online and nginx running, but not if php-fpm is up or whether there is database connectivity etc.

I'd like to change this to do health checks via HTTP, that way I can make some simple checks of the server and return a 200 if all is good and keep the server in the pool.

It seems when I try and access the Forge server via IP (rather than domain), i get a nginx 404, which causes DO to remove the server from the pool as its expecting a 200. Can anyone help me configure a new site in nginx that would respond on IP and load a simple php script in a given path eg /var/www/html

Any help appreciated.


Please sign in or create an account to participate in this conversation.